Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Question: How to do Imperative handling of ODataQueryOptions in business layer and return IList<T> instead of using [EnableQuery] in Controller #1

@maulik-modi

Description

@maulik-modi

Question 1: How to do ODataQueryOptions imperative style handling instead of Processing query in Action filter [EnableQuery]. We would like to avoid bringing DataContext to Controller at all costs.

Question 2: How to declare controller action method and what will be the route?

myBusinessService.cs

IList<T> ApplyUserFilters(ODataQueryOptions userFilterCriteria)
{
   //this includes various filters for Ownership of data based on logged in user
    var myQuery = GetQuery();

  //apply userFilterCriteria on top 
   var finalQuery = myQuery.Apply(userFilterCrtieria)

  //materialise and return result;
  return finalQuery.toList();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions