I'm trying to perform a query without having created a model that maps it. Consider this snippet
public IDictionary<string, int> GetParentelaMapping()
{
using (var conn = dataContextFactory.Create())
{
var result = conn.Query<dynamic>("SELECT ID_GRADO_PARENTELA,GRADO_PARENTELA FROM GRADO_PARENTELA")
.ToDictionary(
row => (string)row.GRADO_PARENTELA,
row => (int)row.ID_GRADO_PARENTELA, StringComparer.OrdinalIgnoreCase);
return result;
}
}
It gaves me an exception that Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: ''int' does not contain a definition for 'GRADO_PARENTELA''
How can I handle such a case? Thanks