//Private Methods private static IOrderedQueryable<Greenhouse_NoBody> GetGreenhousesQuery() { _sharedContext = GetContext(); _sharedContext.DeferredLoadingEnabled = false; return _sharedContext.Greenhouses.Select(g => new Greenhouse_NoBody { GreenhouseId = g.GreenhouseId, Width = g.Width, Height = g.Height, Length = g.Length }).OrderByDescending(g => g.GreenhouseId); }
//Private Methods private static IOrderedQueryable<Crop_NoBody> GetCropsQuery() { _sharedContext = GetContext(); _sharedContext.DeferredLoadingEnabled = false; return _sharedContext.Crops.Select(c => new Crop_NoBody { CropId = c.CropId, Height = c.Height, Length = c.Length, Width = c.Width, Name = c.Name, MaxTemperature = c.MaxTemperature, MinTemperature = c.MinTemperature, MaxHumidity = c.MaxHumidity, MinHumidity = c.MinHumidity, }).OrderByDescending(c => c.CropId); }