Introduce AbpIdentityServerConsts.

pull/206/head
Halil İbrahim Kalkan 8 years ago
parent 2d8ea886f6
commit 66f0a863e9

@ -0,0 +1,9 @@
namespace Volo.Abp.IdentityServer
{
public static class AbpIdentityServerConsts
{
public const string DefaultDbTablePrefix = "IdentityServer";
public const string DefaultDbSchema = null;
}
}

@ -9,9 +9,9 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
{
public class IdentityServerDbContext : AbpDbContext<IdentityServerDbContext>, IIdentityServerDbContext
{
public static string TablePrefix { get; set; } = "IdentityServer";
public static string TablePrefix { get; set; } = AbpIdentityServerConsts.DefaultDbTablePrefix;
public static string Schema { get; set; }
public static string Schema { get; set; } = AbpIdentityServerConsts.DefaultDbSchema;
public DbSet<ApiResource> ApiResources { get; set; }
@ -58,8 +58,7 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
this.ConfigureIdentityServer(builder, TablePrefix, Schema);
builder.ConfigureIdentityServer(TablePrefix, Schema);
}
}
}

@ -1,5 +1,4 @@
using System;
using JetBrains.Annotations;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
@ -10,9 +9,14 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
{
public static class IdentityServerDbContextModelCreatingExtensions
{
public static void ConfigureIdentityServer(this IIdentityServerDbContext dbContext, ModelBuilder builder, string tablePrefix = "", [CanBeNull] string schema = null)
public static void ConfigureIdentityServer(
this ModelBuilder builder,
[CanBeNull] string tablePrefix = AbpIdentityServerConsts.DefaultDbTablePrefix,
[CanBeNull] string schema = AbpIdentityServerConsts.DefaultDbSchema)
{
if (tablePrefix.IsNullOrWhiteSpace())
Check.NotNull(builder, nameof(builder));
if (tablePrefix == null)
{
tablePrefix = "";
}

Loading…
Cancel
Save