Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
 public RequestsController(LifeLineContext context)
 {
     _context = context;
 }
Beispiel #3
0
 public DonorController(LifeLineContext context)
 {
     this._context = context;
 }