Ignore:
Timestamp:
08/07/20 11:01:25 (4 years ago)
Author:
Mile Jankuloski <mile.jankuloski@…>
Branches:
master
Children:
5d02859
Parents:
ee137aa (diff), c406ae5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://develop.finki.ukim.mk/git/farmatiko

File:
1 edited

Legend:

Unmodified
Added
Removed
  • FarmatikoServices/Services/HealthFacilityService.cs

    ree137aa r63d885e  
    44using System;
    55using System.Linq;
     6using System.Threading.Tasks;
    67
    78namespace FarmatikoServices
     
    1617        }
    1718
    18         public void Add(HealthFacilities healthFacility)
     19        public async void Add(HealthFacilities healthFacility)
    1920        {
    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             }
     21            if (healthFacility != null)
     22                await Task.Run(() => _healthFacilityRepository.Add(healthFacility));
     23            else throw new Exception("Can't add, health facility is null");
    3024        }
    3125
    32         public IQueryable<HealthFacilities> GetAll()
     26        public async Task<IQueryable<HealthFacilities>> GetAll()
    3327        {
    34             return _healthFacilityRepository.GetAll();
     28            return await Task.Run(() => _healthFacilityRepository.GetAll());
    3529        }
    3630
    37         public void Remove(HealthFacilities healthFacility)
     31        public async void Remove(HealthFacilities healthFacility)
    3832        {
    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             }
     33            if (healthFacility != null)
     34                await Task.Run(() => _healthFacilityRepository.Remove(healthFacility));
     35            else throw new Exception("Can't Remove health facility is null");
     36
    4937        }
    5038    }
Note: See TracChangeset for help on using the changeset viewer.