Пример #1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ArchPointPHRContext(
                       serviceProvider.GetRequiredService <DbContextOptions <ArchPointPHRContext> >()))
            {
                //Look for any medication
                if (context.Medication.Any())
                {
                    return;     //DB has been seeded
                }

                context.Medication.AddRange(
                    new Medication
                {
                    Name      = "Lipitor",
                    Physician = "John Dee, MD",
                    Quantity  = 2,
                    Dosage    = "20mg",
                    Reason    = "",
                    Type      = "Cholesterol Medication"
                },

                    new Medication
                {
                    Name      = "Plavix",
                    Physician = "John Dee, MD",
                    Quantity  = 2,
                    Dosage    = "30mg",
                    Reason    = "",
                    Type      = "Heart and Stroke"
                },

                    new Medication
                {
                    Name      = "Celebrex",
                    Physician = "John Dee, MD",
                    Quantity  = 2,
                    Dosage    = "200mg",
                    Reason    = "",
                    Type      = "Arthritis"
                }
                    );
                context.SaveChanges();
            }
        }
Пример #2
0
 public IndexModel(ArchPointPHR.Models.ArchPointPHRContext context)
 {
     _context = context;
 }
Пример #3
0
 public CreateModel(ArchPointPHR.Models.ArchPointPHRContext context)
 {
     _context = context;
 }
Пример #4
0
 public EditModel(ArchPointPHR.Models.ArchPointPHRContext context)
 {
     _context = context;
 }
Пример #5
0
 public DetailsModel(ArchPointPHR.Models.ArchPointPHRContext context)
 {
     _context = context;
 }