Flesh out domain and start student commands

This commit is contained in:
Giovani
2019-04-24 17:50:37 +00:00
parent f603e94b5d
commit 17a15766ab
18 changed files with 648 additions and 197 deletions

View File

@@ -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; }
}
}