S
Shapper
Hello,
On a class library I have the following extension:
public static Int32 Execute(this IDbConnection cnn, String sql, dynamic param = null)
I am trying to expose this extension through a method on my class:
public class Repository : IRepository {
private IDbConnection _connection;
public Repository(IDbConnection connection) {
_connection = connection;
} // Repository
public Int32 Execute(String sql, dynamic param = null) {
return _connection.Execute(sql, param);
} // Execute
} // Repository
But I keep getting the following error:
'System.Data.IDbConnection' has no applicable method named 'Execute' but appears to have an extension method by that name. Extension methods cannot bedynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
I tried to change my code in a few ways but no luck ...
Any idea of how to solve this?
Thank You,
Miguel
On a class library I have the following extension:
public static Int32 Execute(this IDbConnection cnn, String sql, dynamic param = null)
I am trying to expose this extension through a method on my class:
public class Repository : IRepository {
private IDbConnection _connection;
public Repository(IDbConnection connection) {
_connection = connection;
} // Repository
public Int32 Execute(String sql, dynamic param = null) {
return _connection.Execute(sql, param);
} // Execute
} // Repository
But I keep getting the following error:
'System.Data.IDbConnection' has no applicable method named 'Execute' but appears to have an extension method by that name. Extension methods cannot bedynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
I tried to change my code in a few ways but no luck ...
Any idea of how to solve this?
Thank You,
Miguel