3

I am using Dapper micro-ORM in my project where i want to select all the records from table. Below is my code.

 var result = connection.Query<Department>("Select * From Department");

and i am getting the following error

No Overload for method 'Query' takes 1 argument

My project's target framework is .net 3.5. If i just change the project's target framework to .net 4.0, and re-install dapper (using nuget) everything is working good.

i don't want to use where clause (i.e. no additional parameter for query method). Is there a way to run this query using dapper targeting .net 3.5 framework?

1 Answer 1

2

In the current code, you must pass a param argument in the NET35 build. This can be null. Try:

var result = connection.Query<Department>("select * from Department", null);
Sign up to request clarification or add additional context in comments.

1 Comment

and if that doesn't work, let me know and I'll deploy the code to NuGet

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.