using System;
using Hncore.Infrastructure.EF;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
namespace Hncore.Pass.Sells.Domain
{
public partial class CourseContext : DbContextBase
{
///
/// 构造函数
///
/// 上下文实体
/// http请求上下文
public CourseContext(DbContextOptions options, IHttpContextAccessor httpContextAccessor) :
base(options, httpContextAccessor)
{
}
public virtual DbSet SellCoupon { get; set; }
public virtual DbSet SellCouponResource { get; set; }
public virtual DbSet SellCouponUserOrgin { get; set; }
public virtual DbSet SellCouponUserUse { get; set; }
public virtual DbSet SellerTaoBao { get; set; }
public virtual DbSet SellerTaoBaoRefund { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity(entity =>
{
entity.ToTable("sell_coupon");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity(entity =>
{
entity.ToTable("sell_coupon_resource");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity(entity =>
{
entity.ToTable("sell_coupon_user_orgin");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity(entity =>
{
entity.ToTable("sell_coupon_user_use");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity(entity =>
{
entity.ToTable("sell_taobao");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity(entity =>
{
entity.ToTable("sell_taobao_refund");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
base.OnModelCreating(modelBuilder);
}
}
}