Old forum URL:

_pisees_ posted on Friday, August 01, 2014

Hi, What is the status of CSLA LINQ Provider support. Is it recommended? For instance, I am looking at exposing a REST API and would like to make OData queries. If CLSA supports IQueryable then can get nice support for OData and a framework like Breeze.js. Thanks,

RockfordLhotka replied on Sunday, August 03, 2014

There's probably a mismatch in expectations here.

Most pass-through LINQ technologies (like Breeze) broadly assume they are running queries against a relational data store (e.g. a database).

CSLA object graphs, if done correctly, reflect a business domain model and are not relational. So you can do some queries against the object graph, but you shouldn't expect the flexibility of dealing with raw data, because you are not - you are dealing with smart objects shaped to reflect the user scenario where the objects are used.

As long as you understand that significant philosophical difference, then you can explore technologies that allow you to take your domain model and return subsets of data from it - obviously after things like authorization rules have been automatically applied. Similarly, you can accept posted data and try to load it into the domain object graph, which may or may not succeed because the object graph will apply all the business rules.

To make that data post scenario more efficient (and easier) there is an interface where you can temporarily disable all the business rule processing, and then have all the rules run for an object once you've set all the property values. Then you can find out if the resulting object is in a valid state or not based on the business rules. This functionality was created specifically to support web post scenarios (from web pages or services).

Copyright (c) Marimer LLC