Search code examples
c#entity-framework-coreopenididentityserver4

How to add new column in Client table in IdentityServer 4 using CodeFirst approach?


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; }
    } 
}

Solution

  • 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.