Files
juipnet/Services/Hncore.Pass.Sells/Domain/CourseContext.cs
“wanyongkang” b562aba2b1 忽略dll文件git
2023-07-29 10:19:42 +08:00

77 lines
2.7 KiB
C#

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
{
/// <summary>
/// 构造函数
/// </summary>
/// <param name="options">上下文实体</param>
/// <param name="httpContextAccessor">http请求上下文</param>
public CourseContext(DbContextOptions<CourseContext> options, IHttpContextAccessor httpContextAccessor) :
base(options, httpContextAccessor)
{
}
public virtual DbSet<CouponEntity> SellCoupon { get; set; }
public virtual DbSet<CouponResourceEntity> SellCouponResource { get; set; }
public virtual DbSet<CouponUserOrginEntity> SellCouponUserOrgin { get; set; }
public virtual DbSet<CouponUserUseEntity> SellCouponUserUse { get; set; }
public virtual DbSet<TaoBaoOrderEntity> SellerTaoBao { get; set; }
public virtual DbSet<TaoBaoRefundEntity> SellerTaoBaoRefund { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<CouponEntity>(entity =>
{
entity.ToTable("sell_coupon");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity<CouponResourceEntity>(entity =>
{
entity.ToTable("sell_coupon_resource");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity<CouponUserOrginEntity>(entity =>
{
entity.ToTable("sell_coupon_user_orgin");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity<CouponUserUseEntity>(entity =>
{
entity.ToTable("sell_coupon_user_use");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity<TaoBaoOrderEntity>(entity =>
{
entity.ToTable("sell_taobao");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
modelBuilder.Entity<TaoBaoRefundEntity>(entity =>
{
entity.ToTable("sell_taobao_refund");
entity.HasKey(p => p.Id);
entity.Property(e => e.Id).ValueGeneratedOnAdd();
});
base.OnModelCreating(modelBuilder);
}
}
}