Changeset 4e72684 for FarmatikoData/FarmatikoRepo/MedicineRepository.cs
- Timestamp:
- 07/29/20 20:02:58 (4 years ago)
- Branches:
- master
- Children:
- a55ef91
- Parents:
- de18858
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/FarmatikoRepo/MedicineRepository.cs
rde18858 r4e72684 1 1 using FarmatikoData.FarmatikoRepoInterfaces; 2 2 using FarmatikoData.Models; 3 using Microsoft.EntityFrameworkCore;4 using System;5 3 using System.Collections.Generic; 6 4 using System.Linq; 7 using System.Text;8 5 9 6 namespace FarmatikoData.FarmatikoRepo … … 24 21 public IEnumerable<Medicine> GetAll() 25 22 { 26 return _context.Medicines. Include(medicine => medicine.Name).Include(medicine => medicine.Strength).Include(medicine => medicine.Form);23 return _context.Medicines.OrderBy(x => x.Name); 27 24 } 28 25 … … 34 31 public IEnumerable<Medicine> GetByName(string Name) 35 32 { 36 return (IEnumerable<Medicine>)_context.Medicines.Where(medicine => medicine.Name == Name);33 return _context.Medicines.Where(medicine => medicine.Name == Name); 37 34 } 38 35 … … 40 37 { 41 38 Medicine med = (Medicine)_context.Medicines.Where(medicine => medicine.Name.Equals(medicine)); 42 _context. Remove(med);39 _context.Medicines.Remove(med); 43 40 } 44 41 }
Note:
See TracChangeset
for help on using the changeset viewer.