How to dynamically change fields in an .NET ORM
- by rsteckly
I'm working in ASP.NET in an application where often users want to add fields or change field names.
I'd like to be able to have an xml schema in place that is parsed and a dynamic object model created from it that can be accessed throughout the application.
My initial reaction is that this is not realistic. I think there is flexibility about the dynamic nature of it. I think the people I'm trying to build this for wouldn't mind recompiling.
Even if the app recompiled, I don't know how to abstract away enough in my code access the data to allow for users changing property names, etc. How can you write LINQ when the properties might change?
In short, there's two questions here: 1) is there a way to dynamically generate an object model of the database and 2) is there a way to abstract away enough so that code accessing the database doesn't break when properties change?