public async Task<GetMortgageOutput> Get(GetMortgageInput input) { GetMortgageOutput output = new GetMortgageOutput(); if (input.MortgageId > 0) { output.SingleMortgage = Mapper.Map<MortgageDto>(await _mortgageRepository.GetAsync(input.MortgageId)); } else { output.SingleMortgage = Mapper.Map<MortgageDto>(new Mortgage()); } return output; }
public async Task<GetMortgageOutput> All() { GetMortgageOutput output = new GetMortgageOutput(); try { output.Mortgages = Mapper.Map<List<MortgageDto>>(await _mortgageRepository.GetAllListAsync()); } catch (Exception e) { throw e; } return output; }