System.Data.SqlClient.SqlConnection does not contain a definition for Query with dapper and c#

The following code when compiling gives the error message below:

'System.Data.SqlClient.SqlConnection' does not contain a definition for 'Query' and no extension method 'Query' accepting a first argument of type 'System.Data.SqlClient.SqlConnection' could be found (are you missing a using directive or an assembly reference?)

I have added Dapper using the nuget packager.

Any ideas? Thanks,

CODE:

using (SqlConnection sqlConnection = new SqlConnection(Connectionstring))
{
    sqlConnection.Open();
    Member customer = sqlConnection.Query<Member>("SELECT * FROM member");
    return customer;
}

Answers


You need to place a using statement in your .cs file to make the Dapper extension methods available.

using ...;
using Dapper;
using ...;

Need Your Help

Double-decoding unicode in python

python unicode utf-8

I am working against an application that seems keen on returning, what I believe to be, double UTF-8 encoded strings.

WebSocket plugin for Jmeter

websocket jmeter jmeter-plugins

Can someone share me a link with plugin sampler for Websocket protocol for JMeter?