示例#1
0
 public static void Init(PeopleDbContext context)
 {
     context.Database.EnsureCreated();
     if (context.Persons.Any())
     {
         return;
     }
     else
     {
         context.Persons.Add(new Person("Mattias", "Rävemåla", "0735-XXXXXX"));
         context.SaveChanges();
     }
 }
示例#2
0
 public PeopleService(PeopleDbContext context)
 {
     _context = context;
 }