[英]Extend Entity Framwork add column to IdentiyServer4 clients table
我有一個屬於Identityserver4的DbContext,我對實體框架還很陌生。
namespace IdentityServer4.EntityFramework.DbContexts
{
public class ConfigurationDbContext : DbContext, IConfigurationDbContext, IDisposable
{
public ConfigurationDbContext(DbContextOptions<ConfigurationDbContext> options, ConfigurationStoreOptions storeOptions);
public DbSet<Client> Clients { get; set; }
public DbSet<IdentityResource> IdentityResources { get; set; }
public DbSet<ApiResource> ApiResources { get; set; }
public Task<int> SaveChangesAsync();
protected override void OnModelCreating(ModelBuilder modelBuilder);
}
}
namespace IdentityServer4.EntityFramework.Entities
{
public class Client
{
// I want to add a column here
................
}
問題是我想擴展Client類,它基本上是數據庫中的clients表,並添加一個新列。 這可能嗎?
我不允許編輯這些文件,因為它們是Identityserver4 dll的一部分。 我唯一能想到的就是創建自己的db上下文並復制IdentityServer所做的事情,但這只是像kill一樣,我不確定IdentityServer是否能夠從新表中讀取。
我要添加到“客戶”表中的問題列。 是一個應用程序ID,用於標識正在使用客戶端的第三方開發人員。 即使他們的客戶或他們在做什么,我們也需要能夠與他們聯系。 在最壞的情況下,禁止行為不端的開發人員。
Client
類具有一個Properties
字典,該字典允許您添加特定於客戶機的值。
從文檔-http: //docs.identityserver.io/zh-CN/release/reference/client.html
屬性 -字典,用於根據需要保存任何自定義客戶端特定的值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.