Пример #1
0
        public OperationResult <Addresses> GetAddress(string id, string addressId)
        {
            var result   = new OperationResult <Addresses>();
            var customer = _customerRepo.Get(id);

            if (customer != null)
            {
                var address = _addrRepo.Get(addressId);
                if (address != null && address.CustomerId == id)
                {
                    result.Data   = address;
                    result.Status = eOperationStatus.Success;
                }
                else
                {
                    result.Status           = eOperationStatus.NotFound;
                    result.ExceptionMessage = "Address not found";
                }
            }
            else
            {
                result.Status           = eOperationStatus.NotFound;
                result.ExceptionMessage = "Customer not found";
            }
            return(result);
        }
 public Addresses Get(Int64 ixAddress) => _addressesRepository.Get(ixAddress);