1

I am interested in using breezejs for my .net mvc3 application, but mainly for its change tracking (I do not want handle querying clientside). Is there a way to accomplish this?
I notice that in order to create an EntityManager you seem to need to back an Iqueryable from the controller.

1 Answer 1

3

There is no requirement that you return an IQueryable from the controller. It is simply that your controller will be unable to process any client side "where", "orderBy","select" etc operations passed from the client if you don't return an IQueryable. ( Note that withParameters will still work though).

So any of these would be valid.

[HttpGet]
public Object Customers() {
  return  < your code >;
}

[HttpGet]
public Object Stuff() {
  return new { Customers = <your code>, Products = <your code> }
}

[HttpGet]
public List<Person> PersonsOlderThan(age) {
  return < your code >;
}

You will still need to either return Metadata from the server or define it on the client.

Hope this helps.

1
  • 1
    To consume the last one, you might write a client-side query such as this: var query = EntityQuery.from("PersonOlderThan").withParameters({ age: 21 });
    – Ward
    Mar 17, 2013 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.