Apply an OData filter at query level in NHibernate

39 views
Skip to first unread message

Cristiano Muzi

unread,
Dec 2, 2021, 5:23:33 AM12/2/21
to nhusers
Hi,

We have a ASP.Net Core Web Api and we use NHibernate. We would like to have OData filtering applied at query level.

I try to explain better: if we add the [EnableQuery] attribute to our endpoints, OData filtering works but it is applied after all records have been fetched from db, while we would like to have the NHibernate query modified to apply filtering at db level.

So basically the question is: if I have a ODataQueryOptions input parameter, how can I use it Filter property to modify the NHibernate query to get data from db?

I found a package named "NHibernate.OData" but it is quite old (2015) and it is not working with version 5 of NHibernate.

Any help is appreciated!

Thank you,
Cristiano Muzi

Roman

unread,
Dec 22, 2021, 9:26:40 AM12/22/21
to nhusers
Reply all
Reply to author
Forward
0 new messages