- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoServices/Services/HealthFacilityService.cs
rc406ae5 ra55ef91 4 4 using System; 5 5 using System.Linq; 6 using System.Threading.Tasks;7 6 8 7 namespace FarmatikoServices … … 17 16 } 18 17 19 public asyncvoid Add(HealthFacilities healthFacility)18 public void Add(HealthFacilities healthFacility) 20 19 { 21 if (healthFacility != null) 22 await Task.Run(() => _healthFacilityRepository.Add(healthFacility)); 23 else throw new Exception("Can't add, health facility is null"); 20 try 21 { 22 if (healthFacility != null) 23 _healthFacilityRepository.Add(healthFacility); 24 } 25 catch (Exception e) 26 { 27 e = new Exception("Can't Add health facility is null"); 28 throw e; 29 } 24 30 } 25 31 26 public async Task<IQueryable<HealthFacilities>> GetAll()32 public IQueryable<HealthFacilities> GetAll() 27 33 { 28 return await Task.Run(() => _healthFacilityRepository.GetAll());34 return _healthFacilityRepository.GetAll(); 29 35 } 30 36 31 public asyncvoid Remove(HealthFacilities healthFacility)37 public void Remove(HealthFacilities healthFacility) 32 38 { 33 if (healthFacility != null) 34 await Task.Run(() => _healthFacilityRepository.Remove(healthFacility)); 35 else throw new Exception("Can't Remove health facility is null"); 36 39 try 40 { 41 if (healthFacility != null) 42 _healthFacilityRepository.Remove(healthFacility); 43 } 44 catch(Exception e) 45 { 46 e = new Exception("Can't Remove health facility is null"); 47 throw e; 48 } 37 49 } 38 50 }
Note:
See TracChangeset
for help on using the changeset viewer.