using FruitBank.Common.Entities; 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 CargoTruckDbTable : MgDbTableBase { public CargoTruckDbTable(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings) : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings) { } public override IOrderedQueryable GetAll() => base.GetAll().OrderBy(p => p.CargoPartnerId); public IQueryable GetAll(bool loadRelations) { return GetAll(); //return loadRelations ? GetAll().LoadWith(sd => sd.CargoTrucks) : GetAll(); } public Task GetByIdAsync(int id, bool loadRelations) => GetAll(loadRelations).FirstOrDefaultAsync(p => p.Id == id); }