Пример #1
0
        public List <GeographicArea> FindGeographicAreasBySaleModality(int saleModalityID)
        {
            Stopwatch timespan = Stopwatch.StartNew();

            try
            {
                SaleModality saleModality = db.SaleModalitys.Where(p => p.SaleModalityID == saleModalityID).Single();
                var          result       = saleModality.SaleModalityGeographicAreas.Select(s => s.GeographicArea).ToList();


                timespan.Stop();
                log.TraceApi("SQL Database", "SaleModalityGeographicAreaRepository.FindGeographicAreasBySaleModality", timespan.Elapsed, "saleModalityID={0}", saleModalityID);

                return(result);
            }
            catch (Exception e)
            {
                log.Error(e, "Error in SaleModalityGeographicAreaRepository.FindGeographicAreasBySaleModality(saleModalityID={0})", saleModalityID);
                throw;
            }
        }
        public async Task <List <DeliveryAmount> > FindDeliveryAmountsBySaleModalityAsync(int saleModalityID)
        {
            Stopwatch timespan = Stopwatch.StartNew();

            try
            {
                SaleModality saleModality = await db.SaleModalitys.Where(p => p.SaleModalityID == saleModalityID).SingleAsync();

                var result = saleModality.SaleModalityDeliveryAmounts.Select(s => s.DeliveryAmount).ToList();


                timespan.Stop();
                log.TraceApi("SQL Database", "SaleModalityDeliveryAmountRepository.FindDeliveryAmountsBySaleModalityAsync", timespan.Elapsed, "saleModalityID={0}", saleModalityID);

                return(result);
            }
            catch (Exception e)
            {
                log.Error(e, "Error in SaleModalityDeliveryAmountRepository.FindDeliveryAmountsBySaleModalityAsync(saleModalityID={0})", saleModalityID);
                throw;
            }
        }