mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
去掉Owin的一些代码
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<#@ template hostspecific="true" language="C#" #>
|
||||
<#@ include file="EF.Utility.CS.ttinclude" #><#@
|
||||
output extension=".cs" #><#
|
||||
|
||||
var efHost = (EfTextTemplateHost)Host;
|
||||
var code = new CodeGenerationTools(this);
|
||||
#>
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using OpenAuth.Domain;
|
||||
using <#= code.EscapeNamespace(efHost.MappingNamespace) #>;
|
||||
|
||||
namespace <#= code.EscapeNamespace(efHost.Namespace) #>
|
||||
{
|
||||
public partial class <#= efHost.EntityContainer.Name #> : DbContext
|
||||
{
|
||||
static <#= efHost.EntityContainer.Name #>()
|
||||
{
|
||||
Database.SetInitializer<<#= efHost.EntityContainer.Name #>>(null);
|
||||
}
|
||||
|
||||
public <#= efHost.EntityContainer.Name #>()
|
||||
: base("Name=<#= efHost.EntityContainer.Name #>")
|
||||
{
|
||||
}
|
||||
|
||||
<#
|
||||
foreach (var set in efHost.EntityContainer.BaseEntitySets.OfType<EntitySet>())
|
||||
{
|
||||
#>
|
||||
public DbSet<<#= set.ElementType.Name #>> <#= set.Name #> { get; set; }
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
<#
|
||||
foreach (var set in efHost.EntityContainer.BaseEntitySets.OfType<EntitySet>())
|
||||
{
|
||||
#>
|
||||
modelBuilder.Configurations.Add(new <#= set.ElementType.Name #>Map());
|
||||
<#
|
||||
}
|
||||
#>
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user