I have what I think is a very simple use case for DapperExtensions:
using (IDbConnection connection = Database.CreateConnection())
{
var model = connection.GetList<MyModelPoco>().ToList();
}
However, an exception is thrown:
Method not found: 'System.Collections.Generic.IEnumerable1<System.__Canon> Dapper.SqlMapper.Query(System.Data.IDbConnection, System.String, System.Object, System.Data.IDbTransaction, Boolean, System.Nullable
1, System.Nullable`1)'.
I'm using NuGet for both Dapper (v1.13) and DapperExtensions (v1.4.3).
Any ideas why this is not working? I added:
using Dapper;
However, that does not affect the outcome. (Resharper also complains that the using directive is not necessary.)
Dapper is working fine when I use it directly (although I notice I'm using it differently than DapperExtensions):
using (IDbConnection connection = Database.CreateConnection())
{
var recordsets = connection.QueryMultiple("stored_procedure_name", new {parameterValue}, commandType:CommandType.StoredProcedure);
var model1 = recordsets.Read<Model1Poco>().SingleOrDefault();
if (model1 == null) return null;
model1.Model2Collection = recordsets.Read<Model2Poco>().ToList();
return model1;
}
I did some "Googling" and it seems that the consensus is that DapperExtensions should be a drop-in and have-fun sort of thing.