public void AddIncludedNavigationProperty(Expression <Func <TEntity, object> > expression) { if (expression == null) { return; } IncludedNavigationProperties ??= new List <string>(); var selectorString = expression.Body.ToString(); IncludedNavigationProperties.Add(selectorString.Remove(0, selectorString.IndexOf('.') + 1)); }
public void AddRangeIncludedNavigationProperty(List <Expression <Func <TEntity, object> > > expressions) { if (expressions == null || !expressions.Any()) { return; } IncludedNavigationProperties ??= new List <string>(); foreach (var selectorString in expressions.Select(expression => expression.Body.ToString())) { IncludedNavigationProperties.Add(selectorString.Remove(0, selectorString.IndexOf('.') + 1)); } }
public void RemoveIncludedNavigationProperty(Expression <Func <TEntity, object> > expression) { if (expression == null) { return; } if (IncludedNavigationProperties != null && IncludedNavigationProperties.Any()) { var selectorString = expression.Body.ToString(); IncludedNavigationProperties.Remove(selectorString.Remove(0, selectorString.IndexOf('.') + 1)); } }