a) In order to load a navigation property of an entity with EntityFramework on server side I can use include:
public virtual IQueryable<TEntity> All(){
IQueryable<TEntity> initialQuery = Context.Set<TEntity>();
IQueryable<TEntity> extendedQuery = initialQuery.Include('MyNavigationProperty');
return extendedQuery;
}
Also see https://msdn.microsoft.com/en-us/magazine/hh205756.aspx
b) Breeze allows to load navigation properties on client side with expand:
var navQuery = breeze.EntityQuery.from('MyEntity')
.expand('MyNavigationProperty');
Also see https://breeze.github.io/doc-js/navigation-properties.html
=> Should I use both of those options if I want to load a navigation property? If not, what are the pros and cons of defining the eagerly loaded navigation properties on server or client side? Are there performance or security issues I have to consider when choosing one of the options?
Is it for example possible to hack the client code to retrieve more navigation properties than the original code would load?
Here someone states that using either include or expand would be enough:
Breeze does not expand a navigation property
However, I am still unsure how/when to use them.