2016-09-02 18:05:17 +08:00
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
// <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>
|
|
|
|
|
//------------------------------------------------------------------------------
|
2017-11-28 23:54:49 +08:00
|
|
|
|
|
2016-09-02 18:05:17 +08:00
|
|
|
|
using System.Data.Entity;
|
2018-05-20 13:54:56 +08:00
|
|
|
|
using System.Data.Entity.Infrastructure;
|
2017-11-29 20:49:14 +08:00
|
|
|
|
using OpenAuth.Repository.Domain;
|
|
|
|
|
using OpenAuth.Repository.Mapping;
|
2015-10-26 21:58:12 +08:00
|
|
|
|
|
2017-11-28 23:54:49 +08:00
|
|
|
|
namespace OpenAuth.Repository
|
2015-10-26 21:58:12 +08:00
|
|
|
|
{
|
2016-09-02 18:05:17 +08:00
|
|
|
|
public partial class OpenAuthDBContext: DbContext
|
2015-10-26 21:58:12 +08:00
|
|
|
|
{
|
2016-09-02 18:05:17 +08:00
|
|
|
|
static OpenAuthDBContext()
|
2015-10-26 21:58:12 +08:00
|
|
|
|
{
|
2016-09-02 18:05:17 +08:00
|
|
|
|
Database.SetInitializer< OpenAuthDBContext>(null);
|
2015-10-26 21:58:12 +08:00
|
|
|
|
}
|
2018-05-07 14:47:16 +08:00
|
|
|
|
|
2015-10-26 21:58:12 +08:00
|
|
|
|
public OpenAuthDBContext()
|
2018-05-07 14:47:16 +08:00
|
|
|
|
: base("Name=OpenAuthDBContext")
|
|
|
|
|
{
|
|
|
|
|
// 关闭语义可空判断
|
|
|
|
|
Configuration.UseDatabaseNullSemantics = true;
|
2018-05-20 13:54:56 +08:00
|
|
|
|
|
|
|
|
|
//与变量的值为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);
|
2018-05-07 14:47:16 +08:00
|
|
|
|
}
|
2015-10-26 21:58:12 +08:00
|
|
|
|
|
2016-09-02 18:05:17 +08:00
|
|
|
|
public OpenAuthDBContext(string nameOrConnectionString)
|
|
|
|
|
: base(nameOrConnectionString)
|
|
|
|
|
{ }
|
2015-10-26 21:58:12 +08:00
|
|
|
|
|
2017-10-11 16:19:34 +08:00
|
|
|
|
public System.Data.Entity.DbSet<Application> Applications { get; set; }
|
2016-09-02 18:05:17 +08:00
|
|
|
|
public System.Data.Entity.DbSet<Category> Categories { get; set; }
|
2017-10-11 16:19:34 +08:00
|
|
|
|
public System.Data.Entity.DbSet<CategoryType> CategoryTypes { get; set; }
|
2016-09-02 18:05:17 +08:00
|
|
|
|
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; }
|
2018-02-28 17:34:27 +08:00
|
|
|
|
|
|
|
|
|
public System.Data.Entity.DbSet<Form> Forms { get; set; }
|
|
|
|
|
|
2018-03-12 23:44:05 +08:00
|
|
|
|
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; }
|
2016-09-14 16:11:46 +08:00
|
|
|
|
|
2015-10-26 21:58:12 +08:00
|
|
|
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
|
|
|
|
{
|
2017-10-11 16:19:34 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new ApplicationMap());
|
2015-12-14 21:39:39 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new CategoryMap());
|
2017-10-11 16:19:34 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new CategoryTypeMap());
|
2015-10-26 21:58:12 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new ModuleMap());
|
2015-11-13 23:25:46 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new ModuleElementMap());
|
2015-10-26 21:58:12 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new OrgMap());
|
2015-11-30 11:58:18 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new RelevanceMap());
|
2015-12-14 21:39:39 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new ResourceMap());
|
2015-10-26 21:58:12 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new RoleMap());
|
2016-01-07 11:47:43 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new StockMap());
|
2016-09-02 18:05:17 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new UserMap());
|
2018-02-28 17:34:27 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new FormMap());
|
2018-03-12 23:44:05 +08:00
|
|
|
|
modelBuilder.Configurations.Add(new FlowInstanceMap());
|
|
|
|
|
modelBuilder.Configurations.Add(new FlowInstanceOperationHistoryMap());
|
|
|
|
|
modelBuilder.Configurations.Add(new FlowInstanceTransitionHistoryMap());
|
|
|
|
|
modelBuilder.Configurations.Add(new FlowSchemeMap());
|
2017-10-11 16:19:34 +08:00
|
|
|
|
|
2015-10-26 21:58:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-09-02 18:05:17 +08:00
|
|
|
|
}
|