using Mango.Nop.Core.Repositories; using Nop.Core.Caching; using Nop.Core.Configuration; using Nop.Core.Events; using Nop.Data; using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities; using Nop.Services.Logging; namespace Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer; public class AuctionBidDbTable : MgDbTableBase { public AuctionBidDbTable(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings, ILogger logger) : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings, logger) { } public Task GetLastAuctionBidByProductToAuctionIdAsync(int prouctToAuctionId) { return Table.Where(x => x.ProductAuctionMappingId == prouctToAuctionId).OrderByDescending(x => x.Id).FirstOrDefaultAsync(); } public IQueryable GetByProductToAuctionIdAsync(int prouctToAuctionId) { return Table.Where(x => x.ProductAuctionMappingId == prouctToAuctionId); } }