You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am pretty sure this is something I should be able to figure out on my own. But reading through all the documentation I can't seem to figure it out. So, sorry about this in advance.
I want to create a query using a dynamically created table. We create our tables in SQL Server using specific SQL Server create commands, not Entity Framework. I was able to use DynamicProperty and DynamicClassFactory to create a class. What I don't know is, how create a query and run the query and get a result back from SQL Server, using the DynamicClass.
I currently create all my queries by hand, since the tables are created at runtime, but I would prefer to use IQuerable and Linq.
Do I have to use entity framework? Right now I am directly running queries using "Microsoft.Data.SqlClient", opening up a SqlConnection etc.
This is as far as I got. We have a class called pTable that has all the properties and types.
This library allows you to make dynamically what you can do in type-safe mode.
It doesn't create or generate any SQL query. For this, you need an ORM such as Entity Framework.
So in short, this library doesn't do what you want (it doesn't generate any SQL at all). However, if you want an example that works with your scenario with Entity Framework, provide us a runnable example ([email protected] if you want to keep it private) that creates your type, and we will try to make it works with EF6 or EF Core depending on your preference.
Johnathan, thanks for quick replay. In our case, we are just going to write the necessary SQL. Would be nice if there was a LINQ to SQL for dynamically created objects.
I am pretty sure this is something I should be able to figure out on my own. But reading through all the documentation I can't seem to figure it out. So, sorry about this in advance.
I want to create a query using a dynamically created table. We create our tables in SQL Server using specific SQL Server create commands, not Entity Framework. I was able to use DynamicProperty and DynamicClassFactory to create a class. What I don't know is, how create a query and run the query and get a result back from SQL Server, using the DynamicClass.
I currently create all my queries by hand, since the tables are created at runtime, but I would prefer to use IQuerable and Linq.
Do I have to use entity framework? Right now I am directly running queries using "Microsoft.Data.SqlClient", opening up a SqlConnection etc.
This is as far as I got. We have a class called pTable that has all the properties and types.
Thanks in advance,
Bryan
The text was updated successfully, but these errors were encountered: