This is my first experience with Dapper.Contrib (latest version from Nuget) and it's a strange situation:
using (SqlConnection cn = new SqlConnection(connectionString))
{
cn.Open();
var product = cn.Get<Product>(1);
}
On SqlMapperExtensions, it raises the error Invalid object name 'Products'
:
public static T Get<T>(this IDbConnection connection,
dynamic id,
IDbTransaction transaction = null,
int? commandTimeout = null) where T : class
{
var type = typeof(T);
string sql;
if (!GetQueries.TryGetValue(type.TypeHandle, out sql))
}
The database receives the command select * from Products where Id = @id
which is wrong.
Why does it append s
to Product?
I've tried with other tables and get the same result.