This is a migrated thread and some comments may be shown as answers.

OpenAccess Projections

1 Answer 69 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tim Lux
Top achievements
Rank 1
Tim Lux asked on 03 Nov 2010, 04:30 PM
I am evaluating OA and ran accross this scenario which I don't know a best way to handle:

The distributed content examples all use a changeset as the passed medium from presentation back to DAL to reassociated with scope.  In my use in an MVC environment, I am getting a projection of domain data for use on a particular view.  The projection is then my model for a page.  Can I get that projection back into a changeset (or be able to access the changeset directly in an MVC environment as the view's model?

Flow:
Controller asks business layer for data (will expect a DTO that will serve as the view model).
Business layer defines specific filter (i.e., an ID)  to an IQueryable that is returned from the DAL.
The business layer uses LINQ against the IQueryable to both apply filters and to project the output into a specified DTO.

Controller recevies the postback DTO from the view, sends it to business layer, and then to DAL. 

The only recourse I see at the moment to ave the data in the DAL is to get the original record (IScope and Extent), apply the changes to the record, and then save.  Works fine, but seems against the grain.  I assume it can pull the record from L2 cache, but won't I be losing concurrency checking unless I can use the ObjectContainer to reassociate?  I can't determine how to put the DTO back into a change set.

I can provide a code sample if needed.

Thanks

1 Answer, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 08 Nov 2010, 11:39 PM
Hi Tim Lux,

 Whatever method you choose you will always have to at one point loose some concurrency as the http protocol is stateless. The recommended approach would be to retrieve the object from in the DAL and update it's values with the one you retrieved from the view. While it might seem a little troublesome at first it is actually preferred. There would be no difference if the L2 cache is enabled or not, regarding concurrency. 

The object container is a bit outdated and one could say deprecated. 

Please do share with us if there is something that is bothering you with the suggested setup and maybe give us a little greater overview of the problem you are facing. 

Sincerely yours,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Getting Started
Asked by
Tim Lux
Top achievements
Rank 1
Answers by
Serge
Telerik team
Share this question
or