mapping single entity type to dynamically generated tables RRS feed

  • Question

  • Hello,

    I am new to entity framework and have the following requirement - 

    I have a set of tables that are generated dynamically from the application, for example - TableNameX with columns like - IdX, DescriptionX, UpdateNameX, UpdateDateX etc. where X can be 0 to 9. So I can have 0 or upto 10 tables at a given point of time in my application.

    I have do to CRUD operations using my application on these tables.

    How do I use entity framework in this kind of scenario ?

    Is it possible that I create a single POCO and then map it dynamically to the tables during the CRUD operations?

    Thanks, Saurav

    Wednesday, April 9, 2014 11:22 AM


  • Your solution is not suitable for EF implementation. I suggest that you look into dynamic parameterized T-SQL for CRUD operations. 
    • Proposed as answer by Fred Bao Thursday, April 10, 2014 2:07 AM
    • Marked as answer by Fred Bao Friday, April 18, 2014 6:57 AM
    Wednesday, April 9, 2014 10:23 PM