There are often more than one way to solve a problem, and this is not an exception. In this case, what you're looking for is allowing users to add new fields to your app and database and use those fields from within your app. Some ways to do that are:
a) Allow the users to modify the database schema.
b) Create a separate structure for defining 'user defined fields' and storing data in them.
c) Create nullable 'reserved' fields in the tables where users are more likely to need their own fields.
I prefer the (b) approach and sometimes the (c) approach whenever user-defined custom fields are needed in an app. Here are some of the pros/cons for each of the three:
Modify schema
• Risky: If you allow the users to modify the database schema, where do you draw the line? If they can add fields they may also go off changing the definition of existing fields, add or remove indexes etc. This can lead to a support nightmare with bugs, performance issues etc triggered by schema modifications done by users.
• Performant: storing the new user defined fields inline in existing tables will usually have a performance advantage over a separate structure, but only as long as they don't go overboard with changes.
• Clunky: EF determines the schema at design-time, so to make this work at runtime you will need to generate new entity classes at runtime with members representing the new fields, and you will need to update the mapping metadata at runtime. The runtime-generated entity classes can inherit from the design-time generated classes so you only need to add members and mappings for the new user defined fields. Although possible, it is clunky. The code that consume the runtime-generated classes will need to use reflection to access the new members that are created at runtime.
Separate structure
• User-friendly: By creating a separate structure for storing custom fields, you can build app logic for users to add/remove those fields etc. They don't need to mess with the database, instead you can have maintenance forms within the app for adding new fields.
• EF-friendly: no need to mess with entity classes and mapping metadata at runtime. Everything is defined at design-time, and the user-defined fields are just data.
• Slightly less performant: Having separate tables for defining and storing the user defined fields can make lookups slightly more costly due to additional roundtrips or additional joins.
Reserved fields
• Often enough: In many situations, custom fields are only used for one or a few extra fields. Reserving a couple of columns will often cover 99% of user needs. Even a generic "remarks" field in every table is often enough in LOB apps.
• Limited: If the users want more fields than you have reserved, or other data types than you have reserved then that can be a limitation.
• Performant: Columns inline, retrieved without extra roundtrips or joins.
• Defined at design-time: No runtime messing about with entity type definitions or mappings.