using EFCoreDatabase.Entities; using Microsoft.EntityFrameworkCore; namespace EFCoreDatabase.Data { public class DmDBContext:DbContext { public DmDBContext(DbContextOptions options) : base(options) { } public DbSet Manage_Main { get; set; } public DbSet Manage_List { get; set; } public DbSet Storage_Main { get; set; } public DbSet Storage_List { get; set; } public DbSet Wh_Cell { get; set; } public DbSet Io_Control_Routes { get; set; } public DbSet Io_Control { get; set; } public DbSet Reserve_Cell { get; set; } public DbSet Sys_Item { get; set; } public DbSet Sys_Item_List { get; set; } public DbSet Stacker_Crane_Status { get; set; } public DbSet Io_Control_Apply_His { get; set; } public DbSet Goods_Main { get; set; } public virtual DbSet V_Storage_List { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { //定义视图无主键 modelBuilder.Entity().HasNoKey(); modelBuilder.Entity(x => x.Property(e => e.WEIGHT_EMPTY_BUCKET).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.WEIGHT_RUBBER).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.MANAGE_LIST_QUANTITY).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.WEIGHT_EMPTY_BUCKET).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.WEIGHT_RUBBER).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.STORAGE_LIST_QUANTITY).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.WEIGHT_EMPTY_BUCKET).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.WEIGHT_RUBBER).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.MANAGE_LIST_QUANTITY).HasColumnType("decimal")); modelBuilder.Entity(x => x.Property(e => e.STORAGE_LIST_QUANTITY).HasColumnType("decimal")); } } }