This question is locked. New answers and comments are not allowed.
I have a web api action as follows:
This returns the applicaiton with Id of 37, but is sending all navigation properties with it. It has children, and those children have children, and those children have children, all of which is being sent to the client. This will be the query that is run on the first page and as it is now, It looks like the entire database will be sent down with this request (the actual app will not filter to just one application).
I added the fetch strategy trying to limit the depth of related objects to be returned, but that did not work. How do you either make it to where it does not fill any of the related objects, or to just one level of related objects.
Thanks,
[HttpGet]
public
IQueryable<Application> TestApplicationList()
{
var entityModel =
new
EntityModel(
"Data Source=.;Initial Catalog=Motion360Platform;Trusted_Connection=True"
,
new
BackendConfiguration
{
Backend =
"mssql"
});
var fs =
new
FetchStrategy();
fs.MaxFetchDepth = 1;
return
entityModel.Applications.Where(w => w.Id == 37);
}
This returns the applicaiton with Id of 37, but is sending all navigation properties with it. It has children, and those children have children, and those children have children, all of which is being sent to the client. This will be the query that is run on the first page and as it is now, It looks like the entire database will be sent down with this request (the actual app will not filter to just one application).
I added the fetch strategy trying to limit the depth of related objects to be returned, but that did not work. How do you either make it to where it does not fill any of the related objects, or to just one level of related objects.
Thanks,