Exemplo n.º 1
0
 public static IConditionalQueryable <TSource> If <TSource>(this IConditionalQueryable <TSource> conditional, bool condition, Func <IQueryable <TSource>, IQueryable <TSource> > expression)
 => condition ? new ConditionalQueryable <TSource>(conditional.Source, e => expression(conditional.Expression(e)), condition) : new ConditionalQueryable <TSource>(conditional.Source, expression, condition);
Exemplo n.º 2
0
 public static TResult Else <TSource, TResult>(this IConditionalQueryable <TSource, TResult> conditional, Func <IQueryable <TSource>, TResult> expression)
 => conditional.IsMet ? conditional.Expression.Invoke(conditional.Source) : expression.Invoke(conditional.Source);
Exemplo n.º 3
0
 public static IQueryable <TSource> Else <TSource>(this IConditionalQueryable <TSource> conditional)
 => conditional.IsMet ? conditional.Expression.Invoke(conditional.Source) : conditional.Source;
Exemplo n.º 4
0
 public static IQueryable <TSource> Else <TSource>(this IConditionalQueryable <TSource> conditional, Func <IQueryable <TSource>, IQueryable <TSource> > expression)
 => conditional.IsMet ? conditional.Expression.Invoke(conditional.Source) : expression.Invoke(conditional.Source);
Exemplo n.º 5
0
 public static IConditionalQueryable <TSource, TResult> ElseIf <TSource, TResult>(this IConditionalQueryable <TSource, TResult> conditional, bool condition, Func <IQueryable <TSource>, TResult> expression)
 => conditional.IsMet ? conditional : new ConditionalQueryable <TSource, TResult>(conditional.Source, expression, condition);