public async Task<GetOwnerOutput> GetOwner(GetOwnerInput input) { GetOwnerOutput output = new GetOwnerOutput(); if (input.OwnerId > 0) { output.SingleOwner = Mapper.Map<OwnerDto>(await _ownerRepository.GetAsync(input.OwnerId)); } else { output.SingleOwner = Mapper.Map<OwnerDto>(new Owner()); } return output; }
public async Task<GetOwnerOutput> GetOwners() { GetOwnerOutput output = new GetOwnerOutput(); try { output.Owners = Mapper.Map<List<OwnerDto>>(await _ownerRepository.GetAllListAsync()); } catch (Exception e) { throw e; } return output; }