locked
dynamic create entity RRS feed

  • Question

  • i have a table named columnsetting, this table was maintain by end user by GUI.

    they can create a column or delete one. and other table to keep the data base on the table structre of columnsetting.

    For example, columnsetting contains two rows, Name Number.  The tab1 will have two columns: Name Number

    when user add another row in columnsetting, age for instance. The tab1 will have another column age too.

    when i use entity framework , the entity was create at design. so when the data in columnsetting  changed, the tab1 entity remain the same.

    is that possibe to create entity at run time depend on the data of columnsetting  ?

    Friday, August 30, 2013 5:16 AM

Answers

  • I believe you are using the EF model first approach. I don't think you can do anything dynamically with the model and the database in the way you are talking about you need.

    However, I believe that you can do what you are talking about using the EF database first approach where you reverse engineer the model based on the database. You may want to check that out. I think you can do it in code too on the fly.

     
    • Proposed as answer by Fred Bao Monday, September 2, 2013 2:05 AM
    • Marked as answer by Andrea Pirlo Monday, September 2, 2013 3:07 PM
    Friday, August 30, 2013 10:45 AM