No LINQ provider can automatically translate an EqualityComparer to SQL. If it does not break the old LINQ provider, then it was silently ignored.
On 11 Dez., 00:34, João Bragança <[email protected]> wrote: > This is not possible. Once the expression tree parser hits a method > call - in this case IEqualityComparer.Equals - it stops. Try doing a > multiline statement in queryable.Where(), build your project and you > will see why. You will either have to a) use the PK in your comparison > b) use composite-id for Item in your mapping to match what you are > doing in IEqualityComparer.Equals c) get the entire list of SubItem > and compare in memory which is probably what the old linq provider was > doing. > > That being said you should be able to compile the old linq provider > against NH3 since it is based on ICriteria. > > On Dec 10, 10:32 am, Scott <[email protected]> wrote: > > > > > Yes, it uses the interface IEqualityComparer. > > > On Dec 10, 12:18 pm, Fabio Maulo <[email protected]> wrote: > > > > Is ItemEqualityComparer a custom function inside your RDBMS ? > > > > On Fri, Dec 10, 2010 at 1:53 PM, Scott <[email protected]> wrote: > > > > This worked with the old Linq provider, no dice on the new one. > > > > > Basically trying to use my own IEqualityComparer > > > > > Here's what I'm doing: > > > > > //Some in memory list of items > > > > List<Item> itemList = new List<Item>(){ new Item(1), new Item(2), new > > > > Item(3) }; > > > > > var result = (from subI in _session.Query<SubItem>() > > > > where itemList.Contains(subI.itemLink, new ItemEqualityComparer()) > > > > select subI).ToList<SubItem>(); > > > > > This gives me the error: > > > > NotSupportedException > > > > Boolean Contains[Model.Item] > > > > (System.Collections.Generic.IEnumerable`1[Model.Item], Model.Item, > > > > System.Collections.Generic.IEqualityComparer` 1 [Model.Item] > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups > > > > "nhusers" group. > > > > To post to this group, send email to [email protected]. > > > > To unsubscribe from this group, send email to > > > > [email protected]<nhusers%[email protected] > > > > > > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/nhusers?hl=en. > > > > -- > > > Fabio Maulo- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
