Flesh out domain and start student commands
This commit is contained in:
@@ -14,12 +14,23 @@ namespace BrightGlimmer.Data
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// dotnet ef migrations add NAME --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Api
|
||||
// dotnet ef migrations update --project ./BrightGlimmer.Data --startup-project ./BrightGlimmer.Api
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Student>()
|
||||
.HasMany(x => x.Phones);
|
||||
modelBuilder.Entity<Student>()
|
||||
.HasOne(x => x.Address);
|
||||
modelBuilder.Entity<Student>()
|
||||
.HasMany(x => x.AssignedCourses);
|
||||
modelBuilder.Entity<AssignedCourse>()
|
||||
.HasOne(x => x.Course);
|
||||
}
|
||||
|
||||
public DbSet<Student> Students { get; set; }
|
||||
public DbSet<Course> Courses { get; set; }
|
||||
public DbSet<AssignedCourse> AssignedCourses { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user