I have two methods:
public static int Insert<T>(this System.Data.IDbConnection connection, T param)
public static int Insert<T>(this System.Data.IDbConnection connection, IList<T> param)
When I try something like this:
connection.Insert(new List<Foo>());
the wrong method (first method) is called.
How can I make it work?
If there are generic overloads that can be implicitly called the same way, you have to use an explicit call.
This code will call the second overload.
connection.Insert<Foo>(new List<Foo>());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With