Exemplo n.º 1
0
        public static List <Patient> GetPatients(HealthContext db)
        {
            List <Patient> patients = new List <Patient>()
            {
                new Patient
                {
                    Name        = "Jim Jhon",
                    Ailments    = new List <Ailment>(db.Ailments.Take(2)),
                    Medications = new List <Medication>(db.Medications.Take(2))
                },
                new Patient
                {
                    Name        = "Ann 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        = "Tom Myer",
                    Ailments    = new List <Ailment>(db.Ailments.OrderBy(m => m.Name).Skip(2).Take(2)),
                    Medications = new List <Medication>(db.Medications.OrderBy(m => m.Name).Skip(2).Take(2))
                },
            };

            return(patients);
        }
 public EntityBaseRepository(HealthContext context)
 {
     _context = context;
 }