mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
转移.net core 3.1,为.NET 5做准备
This commit is contained in:
@@ -1,80 +1,55 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a CodeSmith Template.
|
||||
//
|
||||
// DO NOT MODIFY contents of this file. Changes to this
|
||||
// file will be lost if the code is regenerated.
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using OpenAuth.Repository.Mapping;
|
||||
using OpenAuth.Repository.QueryObj;
|
||||
|
||||
namespace OpenAuth.Repository
|
||||
{
|
||||
public partial class OpenAuthDBContext: DbContext
|
||||
public partial class OpenAuthDBContext : DbContext
|
||||
{
|
||||
static OpenAuthDBContext()
|
||||
|
||||
public OpenAuthDBContext(DbContextOptions<OpenAuthDBContext> options)
|
||||
: base(options)
|
||||
{}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
Database.SetInitializer< OpenAuthDBContext>(null);
|
||||
modelBuilder.Entity<DataPrivilegeRule>()
|
||||
.HasKey(c => new { c.Id });
|
||||
}
|
||||
|
||||
public OpenAuthDBContext()
|
||||
: base("Name=OpenAuthDBContext")
|
||||
{
|
||||
// 关闭语义可空判断
|
||||
Configuration.UseDatabaseNullSemantics = true;
|
||||
public virtual DbSet<Application> Applications { get; set; }
|
||||
public virtual DbSet<Category> Categories { get; set; }
|
||||
public virtual DbSet<CategoryType> CategoryTypes { get; set; }
|
||||
public virtual DbSet<FlowInstance> FlowInstances { get; set; }
|
||||
public virtual DbSet<FlowInstanceOperationHistory> FlowInstanceOperationHistorys { get; set; }
|
||||
public virtual DbSet<FlowInstanceTransitionHistory> FlowInstanceTransitionHistorys { get; set; }
|
||||
public virtual DbSet<FlowScheme> FlowSchemes { get; set; }
|
||||
public virtual DbSet<Form> Forms { get; set; }
|
||||
public virtual DbSet<Module> Modules { get; set; }
|
||||
public virtual DbSet<ModuleElement> ModuleElements { get; set; }
|
||||
public virtual DbSet<Org> Orgs { get; set; }
|
||||
public virtual DbSet<Relevance> Relevances { get; set; }
|
||||
public virtual DbSet<Resource> Resources { get; set; }
|
||||
public virtual DbSet<Role> Roles { get; set; }
|
||||
public virtual DbSet<User> Users { get; set; }
|
||||
public virtual DbSet<UploadFile> UploadFiles { get; set; }
|
||||
|
||||
//与变量的值为null比较
|
||||
//ef判断为null的时候,不能用变量比较:https://stackoverflow.com/questions/682429/how-can-i-query-for-null-values-in-entity-framework?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
|
||||
(this as IObjectContextAdapter).ObjectContext.ContextOptions.UseCSharpNullComparisonBehavior = true;
|
||||
Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
|
||||
}
|
||||
public virtual DbSet<FrmLeaveReq> FrmLeaveReqs { get; set; }
|
||||
|
||||
public OpenAuthDBContext(string nameOrConnectionString)
|
||||
: base(nameOrConnectionString)
|
||||
{ }
|
||||
public virtual DbSet<SysLog> SysLogs { get; set; }
|
||||
|
||||
public System.Data.Entity.DbSet<Application> Applications { get; set; }
|
||||
public System.Data.Entity.DbSet<Category> Categories { get; set; }
|
||||
public System.Data.Entity.DbSet<CategoryType> CategoryTypes { get; set; }
|
||||
public System.Data.Entity.DbSet<Module> Modules { get; set; }
|
||||
public System.Data.Entity.DbSet<ModuleElement> ModuleElements { get; set; }
|
||||
public System.Data.Entity.DbSet<Org> Orgs { get; set; }
|
||||
public System.Data.Entity.DbSet<Relevance> Relevances { get; set; }
|
||||
public System.Data.Entity.DbSet<Resource> Resources { get; set; }
|
||||
public System.Data.Entity.DbSet<Role> Roles { get; set; }
|
||||
public System.Data.Entity.DbSet<Stock> Stocks { get; set; }
|
||||
public System.Data.Entity.DbSet<User> Users { get; set; }
|
||||
public virtual DbSet<SysMessage> SysMessages { get; set; }
|
||||
|
||||
public virtual DbSet<DataPrivilegeRule> DataPrivilegeRules { get; set; }
|
||||
|
||||
public virtual DbSet<WmsInboundOrderDtbl> WmsInboundOrderDtbls { get; set; }
|
||||
public virtual DbSet<WmsInboundOrderTbl> WmsInboundOrderTbls { get; set; }
|
||||
public virtual DbSet<OpenJob> OpenJobs { get; set; }
|
||||
public virtual DbSet<BuilderTable> BuilderTables { get; set; }
|
||||
public virtual DbSet<BuilderTableColumn> BuilderTableColumns { get; set; }
|
||||
|
||||
//非数据库表格
|
||||
public virtual DbQuery<SysTableColumn> SysTableColumns { get; set; }
|
||||
|
||||
public System.Data.Entity.DbSet<Form> Forms { get; set; }
|
||||
|
||||
public System.Data.Entity.DbSet<FlowInstance> FlowInstances { get; set; }
|
||||
public System.Data.Entity.DbSet<FlowInstanceOperationHistory> FlowInstanceOperationHistories { get; set; }
|
||||
public System.Data.Entity.DbSet<FlowInstanceTransitionHistory> FlowInstanceTransitionHistories { get; set; }
|
||||
public System.Data.Entity.DbSet<FlowScheme> FlowSchemes { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Configurations.Add(new ApplicationMap());
|
||||
modelBuilder.Configurations.Add(new CategoryMap());
|
||||
modelBuilder.Configurations.Add(new CategoryTypeMap());
|
||||
modelBuilder.Configurations.Add(new ModuleMap());
|
||||
modelBuilder.Configurations.Add(new ModuleElementMap());
|
||||
modelBuilder.Configurations.Add(new OrgMap());
|
||||
modelBuilder.Configurations.Add(new RelevanceMap());
|
||||
modelBuilder.Configurations.Add(new ResourceMap());
|
||||
modelBuilder.Configurations.Add(new RoleMap());
|
||||
modelBuilder.Configurations.Add(new StockMap());
|
||||
modelBuilder.Configurations.Add(new UserMap());
|
||||
modelBuilder.Configurations.Add(new FormMap());
|
||||
modelBuilder.Configurations.Add(new FlowInstanceMap());
|
||||
modelBuilder.Configurations.Add(new FlowInstanceOperationHistoryMap());
|
||||
modelBuilder.Configurations.Add(new FlowInstanceTransitionHistoryMap());
|
||||
modelBuilder.Configurations.Add(new FlowSchemeMap());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user