public static List <Patient> GetPatients(MedicineDataBase db)
        {
            List <Patient> patients = new List <Patient>()
            {
                new Patient {
                    PatientName = "Anar",
                    Ailments    = new List <Ailment>(db.Ailments.Take(2)),
                    Medications = new List <Medication>(db.Medications.Take(2))
                },
                new Patient {
                    PatientName = "Leman",
                    Ailments    = new List <Ailment>(db.Ailments.Take(1)),
                    Medications = new List <Medication>(db.Medications.OrderBy(m => m.Name).Skip(1).Take(1))
                },
                new Patient {
                    PatientName = "Bahar",
                    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);
        }
Пример #2
0
 public PatientsController(MedicineDataBase context)
 {
     _context = context;
 }