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

Global Fetch Strategy?

2 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 06 Oct 2016, 02:34 PM

Is there any way to define a global fetch strategy (fluently mapped)?  Like everytime I query ObjectX I want nav properties ObjectY and ObjectZ to come down as well...

So can I just set this somewhere in the model itself so the code littered throughout the side doesn't need to be changed\bloated with fetch code?

2 Answers, 1 is accepted

Sort by
0
Accepted
Doroteya
Telerik team
answered on 07 Oct 2016, 01:53 PM
Hello Steve,

In order to achieve this by setting the fetch strategy directly in the context class (the class that inherits OpenAccessContext). The idea is to introduce a method in which you set the fetch strategy and to call this method from the constructor(s) of the context. An example is available in the attached project. You can take a look at the SetFetchStrategy() method.

I hope this helps

Regards,
Doroteya
Telerik by Progress
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 07 Oct 2016, 03:13 PM
Works great thx!
Tags
General Discussions
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Doroteya
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or