BaseDbContext.cs 3.04 KB
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System.Data.SqlClient;

namespace WebRepository
{
    public partial class BaseDbContext: DbContext
    {
        public BaseDbContext(DbContextOptions<BaseDbContext> options) : base(options)
        {
        }
		#region BaseDB
        public virtual DbSet<Map> Maps { get; set; }
        public virtual DbSet<MapPageContent> Map_content_tabs { get; set; }
        public virtual DbSet<MapPoint> MapPoints { get; set; }
        public virtual DbSet<MapStation> MapStations { get; set; }
        public virtual DbSet<MapRegion> MapRegions { get; set; }
        public virtual DbSet<ReportDesign> ReportDesigns { get; set; }
        public virtual DbSet<SysCount> SysCounts { get; set; }
        public virtual DbSet<SysDept> SysDepts { get; set; }
        public virtual DbSet<SysDictData> SysDictDatas { get; set; }
        public virtual DbSet<SysDictType> SysDictTypes { get; set; }
        public virtual DbSet<SysInfo> SysInfos { get; set; }
        public virtual DbSet<SysInterfaceLog> SysInterfaceLogs { get; set; }
        public virtual DbSet<SysJob> SysJobs { get; set; }
        public virtual DbSet<SysJobLog> SysJobLogs { get; set; }
        public virtual DbSet<SysLoginLog> SysLoginLogs { get; set; }
        public virtual DbSet<SysModule> SysModules { get; set; }
        public virtual DbSet<SysModuleElement> SysModuleElements { get; set; }
        public virtual DbSet<SysOperLog> SysOperLogs { get; set; }
        public virtual DbSet<SysRelevance> SysRelevances { get; set; }
        public virtual DbSet<SysRole> SysRoles { get; set; }
        public virtual DbSet<SysUser> SysUsers { get; set; }
        public virtual DbSet<SysUserOnline> SysUserOnlines { get; set; }
        public virtual DbSet<TAgvGroup> TAgvGroups { get; set; }
        public virtual DbSet<TTaskDesign> TTaskDesigns { get; set; }
        public virtual DbSet<TTaskGroup> TTaskGroups { get; set; }
        public virtual DbSet<TTaskType> TTaskTypes { get; set; }
        public virtual DbSet<TTaskAssign> TTaskAssigns { get; set; }
        public virtual DbSet<SysI18nTable> SysI18nTables { get; set; }
        public virtual DbSet<SysI18nText> SysI18nTexts { get; set; }
        public virtual DbSet<AcsWorkstation> AcsWorkstations { get; set; }
        public virtual DbSet<AcsZone> AcsZones { get; set; }
        public virtual DbSet<AcsZoneRelevance> AcsZoneRelevances { get; set; }
        public virtual DbSet<AcsTaskFrom> AcsTaskStartzones { get; set; }
        public virtual DbSet<AcsTaskType> AcsTaskTypes { get; set; }
        public virtual DbSet<AcsTask> AcsTasks { get; set; }
        public virtual DbSet<AcsTaskHis> AcsTaskHises { get; set; }
        #endregion

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            // [DatabaseGenerated(DatabaseGeneratedOption.Computed)]

            modelBuilder.Entity<SysCount>().HasKey(c => c.Type);
            modelBuilder.Entity<SysCount>().Property(c => c.Type).HasColumnName("Type");
        }
    }
}