Ejemplo n.º 1
0
        private static List <Patient> GetPatients(HealthContext db)
        {
            var patients = new List <Patient>
            {
                new Patient
                {
                    Name        = "Jim Jones",
                    Ailments    = new List <Ailment>(db.Ailments.Take(2)),
                    Medications = new List <Medication>(db.Medications.Take(4))
                },
                new Patient
                {
                    Name        = "Smith",
                    Ailments    = new List <Ailment>(db.Ailments.Take(1)),
                    Medications = new List <Medication>(db.Medications.OrderBy(m => m.Name).Skip(1).Take(2))
                },
                new Patient
                {
                    Name        = "john",
                    Ailments    = new List <Ailment>(db.Ailments.Take(3)),
                    Medications = new List <Medication>(db.Medications.OrderBy(m => m.Name).Skip(3).Take(2))
                }
            };

            return(patients);
        }
Ejemplo n.º 2
0
 private static void SaveContextChanges(HealthContext context)
 {
     context.SaveChanges();
 }