improvement
This commit is contained in:
parent
7851e8a8ee
commit
a48ad3d132
|
|
@ -0,0 +1,14 @@
|
|||
using Nop.Core.Caching;
|
||||
using Nop.Core.Configuration;
|
||||
using Nop.Core.Events;
|
||||
using Nop.Data;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
||||
|
||||
public class AuctionBidDbTable: EntityRepository<AuctionBid>
|
||||
{
|
||||
public AuctionBidDbTable(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings) : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
using Mango.Nop.Core.Repositories;
|
||||
using Nop.Data;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
||||
|
||||
public class AuctionDbContext : MgDbContextBase, IAuctionDbSet<AuctionDbTable>, IAuctionBidDbSet<AuctionBidDbTable>
|
||||
{
|
||||
public AuctionDbTable Auctions { get; set; }
|
||||
public AuctionBidDbTable AuctionBids { get; set; }
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
using Nop.Core.Caching;
|
||||
using Nop.Core.Configuration;
|
||||
using Nop.Core.Events;
|
||||
using Nop.Data;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
||||
|
||||
public class AuctionDbTable: EntityRepository<Auction>
|
||||
{
|
||||
public AuctionDbTable(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings) : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
using System.Transactions;
|
||||
using Mango.Nop.Core.Repositories;
|
||||
using Nop.Core;
|
||||
using Nop.Core.Caching;
|
||||
using Nop.Core.Configuration;
|
||||
using Nop.Core.Domain.Catalog;
|
||||
using Nop.Core.Events;
|
||||
using Nop.Data;
|
||||
using Nop.Data.DataProviders;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
||||
|
||||
public class AuctionMgDal : MgDalBase<MgDbContextBase>
|
||||
{
|
||||
public IRepository<Auction> Auctions { get; set; }
|
||||
|
||||
//public AuctionMgDal(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings)
|
||||
// : base(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings)
|
||||
//{
|
||||
//}
|
||||
|
||||
public async Task AddProductToAuction(Product product, Auction auction)
|
||||
{
|
||||
//using var dataContext = ((MsSqlNopDataProvider)_dataProvider).
|
||||
//dataProvider.GetTable<TEntity>().wh
|
||||
|
||||
//using var transaction = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled);
|
||||
//await _dataProvider.InsertEntityAsync()
|
||||
// InsertEntityAsync(product);
|
||||
//transaction.Complete();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using Mango.Nop.Core.Interfaces;
|
||||
using Nop.Data;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
||||
|
||||
public interface IAuctionBidDbSet<TDbTable> : IMgDbTableBase where TDbTable : IRepository<AuctionBid>
|
||||
{
|
||||
public TDbTable AuctionBids { get; set; }
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using Mango.Nop.Core.Interfaces;
|
||||
using Nop.Data;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.DataLayer;
|
||||
|
||||
public interface IAuctionDbSet<TDbTable> : IMgDbTableBase where TDbTable : IRepository<Auction>
|
||||
{
|
||||
public TDbTable Auctions { get; set; }
|
||||
}
|
||||
Loading…
Reference in New Issue