Changeset a55ef91 for FarmatikoData/FarmatikoRepo/MedicineRepository.cs
- Timestamp:
- 07/31/20 10:15:02 (5 years ago)
- Branches:
- master
- Children:
- d8fafb8
- Parents:
- 4e72684
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/FarmatikoRepo/MedicineRepository.cs
r4e72684 ra55ef91 1 1 using FarmatikoData.FarmatikoRepoInterfaces; 2 2 using FarmatikoData.Models; 3 using System .Collections.Generic;3 using System; 4 4 using System.Linq; 5 5 … … 15 15 public void Add(Medicine Medicine) 16 16 { 17 _context. Add(Medicine);17 _context.Medicines.Add(Medicine); 18 18 _context.SaveChangesAsync(); 19 19 } 20 20 21 public I Enumerable<Medicine> GetAll()21 public IQueryable<Medicine> GetAll() 22 22 { 23 23 return _context.Medicines.OrderBy(x => x.Name); 24 24 } 25 25 26 public I Enumerable<Medicine> GetByManufacturer(string Manufacturer)26 public IQueryable<Medicine> GetByManufacturer(string Manufacturer) 27 27 { 28 28 return _context.Medicines.Where(x => x.Name.Contains(Manufacturer)).OrderBy(x => x.Manufacturer); 29 29 } 30 30 31 public I Enumerable<Medicine> GetByName(string Name)31 public IQueryable<Medicine> GetByName(string Name) 32 32 { 33 return _context.Medicines.Where(medicine => medicine.Name ==Name);33 return _context.Medicines.Where(medicine => medicine.Name.Contains(Name)).OrderBy(x => x.Name); 34 34 } 35 35
Note:
See TracChangeset
for help on using the changeset viewer.