31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using Mango.Nop.Core.Repositories;
|
|
using Nop.Data;
|
|
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
using System;
|
|
|
|
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; }
|
|
|
|
public EntityRepository<Auction> Auctions2 { get; set; }
|
|
public IRepository<AuctionBid> AuctionBids2 { get; set; }
|
|
|
|
|
|
public AuctionDbContext(INopDataProvider dataProvider, AuctionDbTable auctionDbTable, AuctionBidDbTable auctionBidDbTable) : base(dataProvider)
|
|
{
|
|
Auctions = auctionDbTable;
|
|
AuctionBids = auctionBidDbTable;
|
|
|
|
//Auctions.Table
|
|
var auctions = DataProvider.GetTable<Auction>().Where(x => x.Closed);
|
|
}
|
|
|
|
//public AuctionDbContext(IRepository<Auction> _auctionRepository, IRepository<AuctionBid> _auctionBidRepository)
|
|
//{
|
|
// Auctions2 = _auctionRepository as EntityRepository<Auction>;
|
|
// AuctionBids2 = _auctionBidRepository;
|
|
//}
|
|
} |