0

Im just wondering if there is a way to run a string based SQL query against the dbContext and inspect the objects coming back to give the object a type at runtime. i.e. I will not know the structure of the SQL string being executed until runtime.

Is this possible?

code example:

My_DataProvidor.DB.Database.SqlQuery<MyDynamicType>("SELECT * FROM CUSTOMER").ToList();

OR

My_DataProvidor.DB.Database.SqlQuery(MyDynamicType,"SELECT * FROM CUSTOMER").ToList();

Thanks

1 Answer 1

1

Found the answer. Using a micro-ORM framework like Dapper or massive.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.