-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinqKit applying nested filtering through extension-method not working #139
Comments
@kuebelkasten, it is your question in SO? |
@sdanyliv Yes. Was not sure if I need to repeat it completely here again. But would be possible to edit my issue here if needed |
Well, answer added: https://stackoverflow.com/a/66650693/10646316 |
@sdanyliv I've added the [Expandable]
public static IEnumerable<TEntity> Get<TEntity, TEntityFilter>(this IEnumerable<TEntity> entities, TEntityFilter filter)
where TEntity : BaseEntity<TEntity>, new()
where TEntityFilter : EntityFilter<TEntity>
{
return entities.Where(e => filter.FilterExpression.Invoke(e));
}
Could it be possbile that the issue is because there are two methods named |
It is not correct way of using Expandable attribute and is not original SO question. |
Sorry. I copied the wrong link to the SO-question. Should be stackoverflow I updated the question accordingly. No idea where the wrong link was from... |
Done. |
@sdanyliv Awesome. Well appreciated. In your copied code there is just one |
Anyway, try to remove |
Yupp. Removed |
Maybe @sdanyliv could help me out with this again as it may be related. I have the following query:
If I run this query I get the exception
When changing the second
the exception
|
I need full call stack. Anyway, weird filtering technique. |
See stackoverflow fo details.
Seems like the
Get
is never called (breakpoints never hit). I already tried using Expression.Lambda<>Compile()
,Invoke()
andExpand()
but still, the extension seems not be invoked before the exception is thrown.On the other hand, using
Where
works as expected.The text was updated successfully, but these errors were encountered: