public async Task <ResponseBase <CustomerModel> > ReadCustomerByIdOrName(long id = 0, string name = "") { var response = new ResponseBase <CustomerModel>(); var service = new CustomerClient(); try { var callback = await service.ReadCustomerByIdOrNameAsync(id, !string.IsNullOrWhiteSpace(name)?name : null); var data = callback.Data; var customer = new CustomerModel() { Id = data.Id, Name = data.Name, Address = data.Address, BirthDate = data.BirthDate, CityId = data.CityId, CityName = data.CityName, CountryId = data.CountryId, CountryName = data.CountryName, DepartmentId = data.DepartmentId, DepartmentName = data.DepartmentName, DocumentId = data.DocumentId, DocumentType = data.DocumentType, DocumentTypeName = data.DocumentTypeName, }; response.Code = callback.Code; response.Data = customer; response.Message = callback.Message; } catch (Exception ex) { response.Code = StatusCode.ServiceUnavailable; response.Message = $"Ups! no se pudieron listar los usuario: {ex.Message}"; } service.Close(); return(response); }