diff --git a/exercise.wwwapi/Models/CohortCourse.cs b/exercise.wwwapi/Models/CohortCourse.cs new file mode 100644 index 0000000..47c8949 --- /dev/null +++ b/exercise.wwwapi/Models/CohortCourse.cs @@ -0,0 +1,30 @@ +using exercise.wwwapi.Repository; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + + +namespace exercise.wwwapi.Models +{ + [Table("cohort_course")] + public class CohortCourse : IEntity + { + [Key] + [Column("id")] + public int Id { get; set; } + + [ForeignKey(nameof(Cohort))] + [Column("cohort_id")] + public int CohortId { get; set; } + + [ForeignKey(nameof(Course))] + [Column("course_id")] + public int CourseId { get; set; } + + public Cohort Cohort { get; set; } + public Course Course { get; set; } + public ICollection UserCCs { get; set; } = new List(); + + + + } +} diff --git a/exercise.wwwapi/Repository/IEntity.cs b/exercise.wwwapi/Repository/IEntity.cs new file mode 100644 index 0000000..3d3ab80 --- /dev/null +++ b/exercise.wwwapi/Repository/IEntity.cs @@ -0,0 +1,7 @@ +namespace exercise.wwwapi.Repository +{ + public interface IEntity + { + int Id { get; set; } + } +} \ No newline at end of file