I'm new to Entity Framework so please excuse if the answer to this question is obvious. We ha开发者_C百科ve few databases with thousands of tables in them. Most of these are data tables, that means each data update process might add or remove tables from the database. I've created edmx file with only the tables I need. All the data tables will be used in dynamic SQL based on the functionality.
Now my question is, Can we use dynamic SQL using Entity Framework. I tried using Entity Client with dynamic SQL, but that doesn't allow me to run the query as those tables are not part of the model. Is there any other way to do it?
EDIT: Adding or Removing tables on each data update process is possible but highly unlikely. We have a reference table that holds references to all the data tables we need. The primary question here really is "Can we use Entity Framework to execute queries against tables that are not part of the model (The tables sometimes might be from another database)?"
Thanks.
This is really not what EF is made for. You might try using a SqlCommand against the DB directly, but I agree with Craig Stuntz on this one.
精彩评论