Exemple #1
0
        public async Task <ServiceResponse <List <Address> > > GetAddresses(Guid regionId)
        {
            try
            {
                var result = await _regionRepository.GetAddresses(regionId);

                if (result.Count > 0)
                {
                    return(new ServiceResponse <List <Address> >(result));
                }
                else
                {
                    return(new ServiceResponse <List <Address> >($"No Addresses were found for the provided anchor"));
                }
            }
            catch (Exception ex)
            {
                return(new ServiceResponse <List <Address> >($"An Error Occured while fetching Addresses. {ex.Message}"));
            }
        }