I am developing a .Net application and I have Database available. I have a category class like :
public partial class Category
{
public int CategoryId {get;set;}
public string CategoryName {get;set;}
}
How can I add dynamic fields to this model and hence to the database? if not possible then is there any other way to fulfill my problem?
I am allowing the user to add his desired custom fields to be added. So, my database schema becomes
Category(CategoryId, CategoryName, CustomField1, CustomField2);
How can I do this using EF 5 and MVC ? Or is there any other way we can do it ?
Categoryclass, which is like a list of objects calledCustomFieldand just add more to that list. So in your DB you would have aCustomFieldstable relating toCategory