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(); } }
public PeopleService(PeopleDbContext context) { _context = context; }