public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var address = await _addressesRepository.GetByIdAsync(id.Value); if (address == null) { return(NotFound()); } return(View(address)); }
public async Task <AddressDomainModel> GetByIdAsync(int id) { var address = await _addressesRepository.GetByIdAsync(id); if (address == null) { return(null); } AddressDomainModel addressDomainModel = new AddressDomainModel { Id = address.Id, CityName = address.CityName, StreetName = address.StreetName }; return(addressDomainModel); }