Changeset e42f61a for FarmatikoData/FarmatikoRepo/MedicineListRepository.cs
- Timestamp:
- 07/29/20 13:21:48 (4 years ago)
- Branches:
- master
- Children:
- de18858
- Parents:
- ef1219a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/FarmatikoRepo/MedicineListRepository.cs
ref1219a re42f61a 20 20 _context.SaveChangesAsync(); 21 21 } 22 // Maybe later 23 /*public MedicineList CheckMedicine(string Name) 24 { 25 return (MedicineList)_context.MedicineLists 26 .Where(medicineList => medicineList.Medicine.Name.Contains(Name)) 27 .OrderBy(x => x.Medicine.Name); 28 }*/ 22 29 23 public MedicineList CheckMedicine(string Name)30 public ICollection<MedicineList> GetAll() 24 31 { 25 return ( MedicineList)_context.MedicineLists.Where(medicineList => medicineList.Medicine.Name.Equals(Name));32 return (ICollection<MedicineList>)_context.MedicineLists.OrderBy(x => x.Medicine.Name); 26 33 } 27 34 28 public MedicineList GetAll()35 public ICollection<MedicineList> GetByManufacturer(string Manufacturer) 29 36 { 30 return (MedicineList)_context.MedicineLists.Include(list => list.Medicine).Include(list => list.HasMedicine); 37 return (ICollection<MedicineList>)_context.MedicineLists 38 .Where(x => x.Medicine.Manufacturer.Contains(Manufacturer)) 39 .OrderBy(x => x.Medicine.Name); 40 } 41 public ICollection<MedicineList> GetByName(string Name) 42 { 43 return (ICollection<MedicineList>)_context.MedicineLists 44 .Where(x => x.Medicine.Name.Contains(Name)) 45 .OrderBy(x => x.Medicine.Name); 31 46 } 32 47 33 48 public void Remove(MedicineList medicineList) 34 49 { 35 //throw new NotImplementedException(); 36 //Implement later 50 var list = (MedicineList)_context.MedicineLists.Where(x => x.Equals(medicineList)); 51 _context.Remove(list); 52 } 53 54 public void SetHasMedicine(MedicineList medicineList, bool HasMedicine) 55 { 56 var medicine = _context.MedicineLists.Where(x => x.Medicine.Equals(medicineList.Medicine)); 37 57 } 38 58 }
Note:
See TracChangeset
for help on using the changeset viewer.