Changeset 1db5673 for FarmatikoData/FarmatikoRepo/Repository.cs
- Timestamp:
- 11/14/20 12:27:30 (3 years ago)
- Branches:
- master
- Children:
- 68454c6
- Parents:
- ad60966
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/FarmatikoRepo/Repository.cs
rad60966 r1db5673 41 41 } 42 42 43 public async Task<IEnumerable<Medicine>> GetMedicines() 44 { 45 var Medicines = await _context.Medicines.Take(3).ToListAsync(); 43 public async Task<IEnumerable<Medicine>> GetMedicinesAsync() 44 { 45 var Medicines = await _context.Medicines.Select(x => new Medicine 46 { 47 Name = x.Name, 48 Strength = x.Strength, 49 Form = x.Form, 50 WayOfIssuing = x.WayOfIssuing, 51 Manufacturer = x.Manufacturer, 52 Price = x.Price, 53 Packaging = x.Packaging 54 55 }).Take(3).ToListAsync(); 46 56 return Medicines; 47 57 } … … 205 215 public Task UpdateMedicine(Medicine medicine) 206 216 { 207 throw new System.NotImplementedException();217 throw new NotImplementedException(); 208 218 } 209 219 … … 227 237 return users; 228 238 } 239 240 public User GetRole(string userName) 241 { 242 var user = _context.Users.Where(x => x.Email.Equals(userName)).FirstOrDefault(); 243 return user; 244 } 245 246 public ICollection<Medicine> GetMedicines() 247 { 248 var Medicines = _context.Medicines.Select(x => new Medicine 249 { 250 Id = x.Id, 251 Name = x.Name, 252 Strength = x.Strength, 253 Form = x.Form, 254 WayOfIssuing = x.WayOfIssuing, 255 Manufacturer = x.Manufacturer, 256 Price = x.Price, 257 Packaging = x.Packaging, 258 MedicineList = x.MedicineList 259 260 }).ToList(); 261 return Medicines; 262 } 263 264 public ICollection<PharmacyHeadMedicine> GetPHMedicines(string email) 265 { 266 var head = _context.PharmacyHeads.Where(x => x.Email.Equals(email)).FirstOrDefault(); 267 var phmeds = _context.PharmacyHeadMedicines.Where(x => x.PheadId == head.Id).ToList(); 268 return phmeds; 269 } 229 270 } 230 271 }
Note:
See TracChangeset
for help on using the changeset viewer.