예제 #1
0
        public Store[] GetStoresByIds(string[] ids)
        {
            var retVal = Stores.Where(x => ids.Contains(x.Id)).Include(x => x.Languages)
                         .Include(x => x.Currencies).ToArray();
            var paymentMethods  = StorePaymentMethods.Where(x => ids.Contains(x.StoreId)).ToArray();
            var shipmentMethods = StoreShippingMethods.Where(x => ids.Contains(x.StoreId)).ToArray();
            var taxProviders    = StoreTaxProviders.Where(x => ids.Contains(x.StoreId)).ToArray();

            return(retVal);
        }
예제 #2
0
        public async Task <StoreEntity[]> GetStoresByIdsAsync(string[] ids)
        {
            var retVal = await Stores.Where(x => ids.Contains(x.Id))
                         .Include(x => x.Languages)
                         .Include(x => x.Currencies)
                         .Include(x => x.TrustedGroups)
                         .ToArrayAsync();

            var paymentMethods     = StorePaymentMethods.Where(x => ids.Contains(x.StoreId)).ToArrayAsync();
            var shipmentMethods    = StoreShippingMethods.Where(x => ids.Contains(x.StoreId)).ToArrayAsync();
            var fulfillmentCenters = StoreFulfillmentCenters.Where(x => ids.Contains(x.StoreId)).ToArrayAsync();

            await Task.WhenAll(paymentMethods, shipmentMethods, fulfillmentCenters);

            return(retVal);
        }
예제 #3
0
        public StoreEntity[] GetStoresByIds(string[] ids)
        {
            var result = Array.Empty <StoreEntity>();

            if (!ids.IsNullOrEmpty())
            {
                result = Stores.Where(x => ids.Contains(x.Id))
                         .Include(x => x.Languages)
                         .Include(x => x.Currencies)
                         .Include(x => x.TrustedGroups)
                         .ToArray();

                if (result.Any())
                {
                    ids = result.Select(x => x.Id).ToArray();
                    var paymentMethods     = StorePaymentMethods.Where(x => ids.Contains(x.StoreId)).ToArray();
                    var shipmentMethods    = StoreShippingMethods.Where(x => ids.Contains(x.StoreId)).ToArray();
                    var taxProviders       = StoreTaxProviders.Where(x => ids.Contains(x.StoreId)).ToArray();
                    var fulfillmentCenters = StoreFulfillmentCenters.Where(x => ids.Contains(x.StoreId)).ToArray();
                }
            }

            return(result);
        }