Exemplo n.º 1
0
        private bool AddOrUpdateAddress(riderDto riderDto)
        {
            bool blReturn = true;

            try
            {
                Address address = riderDto.address;
                address.UserId = riderDto.Id;

                var dbValue = GetAddressById(riderDto.Id);

                blReturn = (dbValue == null) ? _riderRepository.AddAddressToDatabase(address) : _riderRepository.EditObjectInDatabase(dbValue, address);
            }
            catch (Exception ex)
            {
            }

            return(blReturn);
        }