I have been download DynamicLinq library via nuget package. I used it like below
db.ReservationSet.Where("blbalbabla",1,2)
But i get below exception.
Error 38 The call is ambiguous between the following methods or properties: 'System.Linq.Dynamic.DynamicQueryable.Where(System.Linq.IQueryable, string, params object[])' and 'System.Linq.Dynamic.DynamicQueryable.Where(System.Linq.IQueryable, string, params object[])' F:\Projects\IEKeysNew\IEKEYS\Controllers\ReportController.cs 145 22 IEKEYS
Here is sign of both methods.
public static IQueryable<T> Where<T>(this IQueryable<T> source, string predicate, params object[] values);
public static IQueryable Where(this IQueryable source, string predicate, params object[] values);
I could not find something to get rid of this compile time exception.
Extension Methods is a new feature in C# 3.0 and the Common Language Runtime, which allows existing classes to use extra methods (extension methods) without being implemented in the same class or obtained by inheritance.
The only difference between a regular static method and an extension method is that the first parameter of the extension method specifies the type that it is going to operator on, preceded by the this keyword.
Extension methods cannot access private variables in the type they are extending.
To define and call the extension methodDefine a static class to contain the extension method. The class must be visible to client code. For more information about accessibility rules, see Access Modifiers. Implement the extension method as a static method with at least the same visibility as the containing class.
Unfortunately another third party .dll library contains the same dynamic linq library internaly. Trirand's jQGrid library contains dynamic linq library and that is the reason for the conflict when I import System.Linq.Dynamic library.
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