public QuoteRequestEntity[] GetQuoteRequestByIds(params string[] ids) { var retVal = QuoteRequests.Include(x => x.Addresses) .Include(x => x.Attachments) .Include(x => x.Items.Select(y => y.ProposalPrices)) .Where(x => ids.Contains(x.Id)).ToArray(); return(retVal); }
public async Task <QuoteRequestEntity[]> GetQuoteRequestByIdsAsync(params string[] ids) { var result = await QuoteRequests.Where(x => ids.Contains(x.Id)).ToArrayAsync(); ids = result.Select(x => x.Id).ToArray(); if (!ids.IsNullOrEmpty()) { await Addresses.Where(x => ids.Contains(x.QuoteRequestId)).LoadAsync(); await Attachments.Where(x => ids.Contains(x.QuoteRequestId)).LoadAsync(); await QuoteItems.Include(x => x.ProposalPrices) .Where(x => ids.Contains(x.QuoteRequestId)).ToArrayAsync(); await DynamicPropertyObjectValues.Where(x => ids.Contains(x.ObjectId)).LoadAsync(); } return(result); }