using FruitBank.Common.Entities; using LinqToDB; using Mango.Nop.Data.Repositories; using Nop.Core.Caching; using Nop.Core.Configuration; using Nop.Core.Events; using Nop.Data; namespace Nop.Plugin.Misc.FruitBankPlugin.Domains.DataLayer; public class StockTakingItemPalletDbTable : MgDbTableBase { public StockTakingItemPalletDbTable(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings) : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings) { } public override IQueryable GetAll() => base.GetAll(); public IQueryable GetAll(bool loadRelations) { return loadRelations ? GetAll() .LoadWith(stip => stip.StockTakingItem).ThenLoad(sti => sti.StockTaking) .LoadWith(stip => stip.StockTakingItem).ThenLoad(sti => sti.Product).ThenLoad(prod => prod.GenericAttributes) : GetAll(); } }