Zbig,
Instead of use strings and to prevent runtime error, I've created these extensions methods:
public static IFetchOptions<T> Include<T>(this IFetchOptions<T> source, params string[] attachedPropertyPaths)
{
return source.Include(IncludeHelper.GetPropertyPath(attachedPropertyPaths));
}
public static IFetchOptions<T> Include<T>(this IFetchOptions<T> source, Expression<Func<T, object>> expr, params string[] attachedPropertyPaths)
{
return source.Include(IncludeHelper.GetPropertyPath(expr, attachedPropertyPaths));
}
How to use:
IncludeExpression = c => c.Include(f => f.FilterCategory)
.Include(f => f.FilterOperatorClauses)
.Include(f => f.FilterOperatorClauses, FilterOperatorClause.EntityPropertyNames.FilterConditions)
.Include(f => f.FilterOperatorClauses, FilterOperatorClause.EntityPropertyNames.FilterConditions, FilterCondition.EntityPropertyNames.FilterConditionValues)
I hope this may help you.