Breeze / breeze.server.net

Breeze support for .NET servers
MIT License
76 stars 62 forks source link

Applying Client Query in Controller #21

Closed kdelmonte closed 9 years ago

kdelmonte commented 9 years ago

Is there anyway to apply the user query in the controller in order to perform some actions to the final result set?

Take the following example:

[HttpGet]
public IQueryable<Container> Containers(bool populate)
{
    var containers = _contextProvider.Context.Containers;
    if (populate)
    {
         foreach (var container in containers)
         {
             container.Populate(_contextProvider.Context);
         }
    }
    return containers;
}

The problem here is that I am doing this Populate() action to all records in this table instead of just the ones that the user requested because their query has not been applied yet. How can I achieve this?

Please see StackOverflow question here.

steveschmitt commented 9 years ago

Answered on StackOverflow

kdelmonte commented 9 years ago

This is exactly what I needed. Thank you very much.