Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }