如何使用CodeFirst方法在IdentityServer 4的客户端表中添加新列? [英] How to add new column in Client table in IdentityServer 4 using CodeFirst approach?
本文介绍了如何使用CodeFirst方法在IdentityServer 4的客户端表中添加新列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在实现IdentityServer4.我试图将新字段CustomerId添加到客户端.进行迁移时,它正在创建名称为Client的新表,而不是在Clients表中添加新列.
I am implementing IdentityServer4. I tried to add new field CustomerId to Client. While doing migration, it is creating new table with name as Client instead of adding new column in Clients table.
namespace xx.xx.Models {
[Table("Clients")]
public class ApplicationClient : Client
{
public string CustomerId { get; set; }
}
}
推荐答案
它们不提供以这种方式扩展模型的功能.但是ClientProperties确实存在,因此您可以使用它来将自定义属性存储为键/值对.
They don't provide the ability to extend the model in this way. However ClientProperties does exist so you could use that to store custom properties as key/value pairs.
这篇关于如何使用CodeFirst方法在IdentityServer 4的客户端表中添加新列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文