Search code examples
aspnetboilerplate

Best way to add column to AbpLanguage and AbpLanguageText?


I want to add a new column to Language tables but unlike other models (User, Role,...) I could not find the Language model classes in the solution. I tried to create a new model (MyLanguages) inherited from ApplicationLanguage but it is a bad way because I have to do many things. So what is the best way to do it?


Solution

  • There's no easy way of achieving this issue. like you said, it's not same as User/Role entity. You can create a new entity called MyLanguage and inherit from Language. After that you'll have a Discriminator column. Add a migration to update all existing languages to MyLanguage in discriminator column. Then you have to write custom code to update a new added language to MyLanguage.

    https://aspnetzero.com/Documents/Extending-Existing-Entities