Base solution for your next web application
Open Closed

Data Filter on a Range of Values #2718


User avatar
0
mcmaestro created

We have tenant users that will need to login and have another filter that filters all of the "companies" they are allowed to access.

I have seen examples of the data filter boilerplate uses work for a specific value but not for a range and I want to know if it is possible.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We use EntityFramework.DynamicFilters for this purpose, <a class="postlink" href="https://github.com/jcachat/EntityFramework.DynamicFilters">https://github.com/jcachat/EntityFramew ... micFilters</a>. I think it is possible,

    In it's homepage there is an example like this, but I didn't try this before:

    var values = new List<int> { 1, 2, 3, 4, 5 };
    modelBuilder.Filter("ContainsTest", (BlogEntry b, List<int> valueList) => valueList.Contains(b.IntValue.Value), () => values);
    

    You can give it a try.