62,025
社区成员
发帖
与我相关
我的任务
分享
public class Product
{
public int Id{get;set;}
public string name{get;set;}
public int CategoryId{get;set;}
public virtual Category Category{get;set;}
}
public class Category
{
public int CategoryId{get;set;}
public string Name {get;set;}
public string remarks{get;set;}
public virtual ICollection<Product> Products{get;set;}
}
public store Context:DbContext
{
public DbSet<Product> Products{get;set;}
public DbSet<Category> Categories{get;set;}
}
/// <summary>
/// 老师
/// </summary>
public class Teacher : IEntity
{
public int Id { get; set; }
public string Name { get; set; }
public string Info { get; set; }
public DateTime CreateTime { get; set; }
public virtual List<TeacherCourse> TeacherCourses { get; set; }
}
/// <summary>
/// 学科
/// </summary>
public class Course : IEntity
{
public int Id { get; set; }
public string Name { get; set; }
public string Info { get; set; }
}
/// <summary>
/// 老师-学科.
/// </summary>
public class TeacherCourse
{
public int Id { get; set; }
public int TeacherId { get; set; }
public virtual Teacher Teachers { get; set; }
public int CourseId { get; set; }
public virtual Course Courses { get; set; }
}