Пример #1
0
        public IQueryable <InventoryLocations> selectInventoryLocations()
        {
            //Custom Code Start | Added Code Block
            var allowedLocationFunctions = _locationfunctionsRepository.IndexDb().Where(x =>
                                                                                        x.sLocationFunctionCode == "CN" ||
                                                                                        x.sLocationFunctionCode == "SH" ||
                                                                                        x.sLocationFunctionCode == "TR" ||
                                                                                        x.sLocationFunctionCode == "ST"
                                                                                        ).Select(x => x.ixLocationFunction).ToList();
            //Custom Code End

            List <InventoryLocations> inventorylocations = new List <InventoryLocations>();

            _context.InventoryLocations.Include(a => a.Companies).Include(a => a.Facilities).Include(a => a.FacilityAisleFaces).Include(a => a.FacilityFloors).Include(a => a.FacilityWorkAreas).Include(a => a.FacilityZones).Include(a => a.InventoryLocationSizes).Include(a => a.LocationFunctions).Include(a => a.UnitsOfMeasurementFKDiffXOffsetUnit).Include(a => a.UnitsOfMeasurementFKDiffYOffsetUnit).Include(a => a.UnitsOfMeasurementFKDiffZOffsetUnit).AsNoTracking()
            .ToList()
            //Custom Code Start | Replaced Code Block
            //Replaced Code Block Start
            //.ForEach(x => inventorylocations.Add(x));
            //Replaced Code Block End
            .ForEach(x =>
            {
                if (allowedLocationFunctions.Contains(x.LocationFunctions.ixLocationFunction))
                {
                    inventorylocations.Add(x);
                }
            }

                     );
            //Custom Code End
            return(inventorylocations.AsQueryable());
        }
Пример #2
0
 public List <LocationFunctions> getLocationFunctions()
 {
     return(_locationfunctionsRepository.IndexDb().ToList());
 }
Пример #3
0
 public IQueryable <LocationFunctions> IndexDb() => _locationfunctionsRepository.IndexDb();