public Domain.Admin GetAdminById(string Id) { return(adminParticipantRepo.SearchFor(x => x.Id == Id) .Include(s => s.ApplicationUser) .Include(s => s.ApplicationUser.Roles.Select(r => r.Role)) .FirstOrDefault()); }
private async Task <RentContractModel> GetByIdAsync(string ID) { RentContractModel contract = null; var domainContract = contractsRepo.SearchFor(x => x.Id == ID).FirstOrDefault(); if (domainContract != null) { (var success, var message, var contractResponse) = await bcContracts.GetById(ID); contract = new RentContractModel { ID = contractResponse.contractId, contractProvider = participantsProcessor.AdminDomainToApiModel(participantsProcessor.GetAdminById(contractResponse.GetIDFromAttributedID(contractResponse.contractProvider))), contractClient = participantsProcessor.ClientDomainToApiModel(participantsProcessor.GetClientById(contractResponse.GetIDFromAttributedID(contractResponse.contractClient))), expiryDate = contractResponse.expiryDate, durationDays = contractResponse.durationDays, status = contractResponse.status, content = contractResponse.content }; } return(contract); }