Trying to use Dapper.Aot inside a new .net 8 preview web api aot project and i am getting no definition for query off the sql connection object

663 views Asked by At

I have installed dapper.aot to the project here are my using statements


using Microsoft.Data.SqlClient;
using Dapper;
using System.Data;
using System.Data.Common;

//I am simply trying var 
  con = new SqlConnection(_connectionString);
  con.Open();
  var test5 = con.Query<Program>("SELECT Name, Acronym FROM Programs");

I get that there is no definition for query or any of the other dapper query methods off connection. I have the ability to see that there is a dapper "command" object off the connection but cant use normal dapper syntax. I am very new to dapper but this should work, and yes I have the attribute [DapperAot] over my Program model.

I expected to find the query methods off the connection

0

There are 0 answers