예제 #1
0
        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));
        }
예제 #2
0
 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));
     }
 }
예제 #3
0
 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));
     }
 }