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

detach dto from dal

1 Answer 76 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Murilo
Top achievements
Rank 1
Murilo asked on 19 Jun 2012, 05:10 PM
Hey, we are testing telerik's orm this week and we are facing some trouble, is it possible to detach the persisted generated classes generated by the orm to another project?

This way we would only add a reference to the business layer and the dto layer and our programmers wouldn't be able to access the IQueryable objects but they would be able to access the persisted classes and send them to the business layer where they can access the IQueryable

we are trying with the lastest release but we found no documentation about this scenario.

Scenario:
DTL -> contains the persisted classes generated by the DAL
DAL -> contains the .rlinq file and will connect to the database
BL -> can access the daos and the dtos
View Layer -> contains all the user interface and will only have access to DTL and BL

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 22 Jun 2012, 12:10 PM
Hi Murilo,

You could use the OpenAccessContext.CreateDetachedCopy<T>(IEnumerable<T> entities, FetchStrategy fetchStrategy) method to detach a collection of persistent capable instances, applying custom fetch strategy, in order to fetch additional referenced data. Later on the detached collection can be used in your scenario.

Actually if you retrieve the context endpoints (context.Categories), and cache it after disposing the context instance you will be able to use the collection as well.

Hope that helps.


Kind regards,
Damyan Bogoev
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
Data Access Free Edition
Asked by
Murilo
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or