public static void Initialize(IServiceProvider provider) { using (var context = new LifeLineContext( provider.GetRequiredService <DbContextOptions <LifeLineContext> >())) { if (context.Set <Donor>().Any()) { return; } context.Set <Donor>().Add( new Donor { DonorName = "John Doe", DonorBloodtype = BloodType.ABNeg, DonorCellNumber = "923001234567", City = "Karachi" }); context.SaveChangesAsync(); } }
public RequestsController(LifeLineContext context) { _context = context; }
public DonorController(LifeLineContext context) { this._context = context; }