< Summary

Information
Class: Pozitron.QuerySpecification.IncludableBuilderExtensions
Assembly: Pozitron.QuerySpecification
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Builders/IncludableBuilderExtensions.cs
Tag: 44_11195777782
Line coverage
100%
Covered lines: 24
Uncovered lines: 0
Coverable lines: 24
Total lines: 92
Line coverage: 100%
Branch coverage
100%
Covered branches: 24
Total branches: 24
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ThenInclude(...)100%11100%
ThenInclude(...)100%66100%
ThenInclude(...)100%11100%
ThenInclude(...)100%66100%
ThenInclude(...)100%11100%
ThenInclude(...)100%66100%
ThenInclude(...)100%11100%
ThenInclude(...)100%66100%

File(s)

/home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Builders/IncludableBuilderExtensions.cs

#LineLine coverage
 1namespace Pozitron.QuerySpecification;
 2
 3public static class IncludableBuilderExtensions
 4{
 5    public static IIncludableSpecificationBuilder<TEntity, TResult, TProperty> ThenInclude<TEntity, TResult, TPreviousPr
 6        this IIncludableSpecificationBuilder<TEntity, TResult, TPreviousProperty> previousBuilder,
 7        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression)
 8        where TEntity : class
 159        => ThenInclude(previousBuilder, thenIncludeExpression, true);
 10
 11    public static IIncludableSpecificationBuilder<TEntity, TResult, TProperty> ThenInclude<TEntity, TResult, TPreviousPr
 12        this IIncludableSpecificationBuilder<TEntity, TResult, TPreviousProperty> previousBuilder,
 13        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression,
 14        bool condition)
 15        where TEntity : class
 16    {
 1917        if (condition && !previousBuilder.IsChainDiscarded)
 18        {
 919            var expr = new IncludeExpression(thenIncludeExpression, typeof(TEntity), typeof(TProperty), typeof(TPrevious
 920            previousBuilder.Specification.Add(expr);
 21        }
 22
 1923        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TResult, TProperty>(previousBuilder.Specificati
 1924        return includeBuilder;
 25    }
 26
 27    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 28        this IIncludableSpecificationBuilder<TEntity, TPreviousProperty> previousBuilder,
 29        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression)
 30        where TEntity : class
 2231        => ThenInclude(previousBuilder, thenIncludeExpression, true);
 32
 33    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 34        this IIncludableSpecificationBuilder<TEntity, TPreviousProperty> previousBuilder,
 35        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression,
 36        bool condition)
 37        where TEntity : class
 38    {
 2639        if (condition && !previousBuilder.IsChainDiscarded)
 40        {
 1641            var expr = new IncludeExpression(thenIncludeExpression, typeof(TEntity), typeof(TProperty), typeof(TPrevious
 1642            previousBuilder.Specification.Add(expr);
 43        }
 44
 2645        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TProperty>(previousBuilder.Specification, !cond
 2646        return includeBuilder;
 47    }
 48
 49    public static IIncludableSpecificationBuilder<TEntity, TResult, TProperty> ThenInclude<TEntity, TResult, TPreviousPr
 50        this IIncludableSpecificationBuilder<TEntity, TResult, IEnumerable<TPreviousProperty>> previousBuilder,
 51        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression)
 52        where TEntity : class
 1453        => ThenInclude(previousBuilder, thenIncludeExpression, true);
 54
 55    public static IIncludableSpecificationBuilder<TEntity, TResult, TProperty> ThenInclude<TEntity, TResult, TPreviousPr
 56        this IIncludableSpecificationBuilder<TEntity, TResult, IEnumerable<TPreviousProperty>> previousBuilder,
 57        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression,
 58        bool condition)
 59        where TEntity : class
 60    {
 1861        if (condition && !previousBuilder.IsChainDiscarded)
 62        {
 863            var expr = new IncludeExpression(thenIncludeExpression, typeof(TEntity), typeof(TProperty), typeof(IEnumerab
 864            previousBuilder.Specification.Add(expr);
 65        }
 66
 1867        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TResult, TProperty>(previousBuilder.Specificati
 1868        return includeBuilder;
 69    }
 70
 71    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 72        this IIncludableSpecificationBuilder<TEntity, IEnumerable<TPreviousProperty>> previousBuilder,
 73        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression)
 74        where TEntity : class
 2375        => ThenInclude(previousBuilder, thenIncludeExpression, true);
 76
 77    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 78        this IIncludableSpecificationBuilder<TEntity, IEnumerable<TPreviousProperty>> previousBuilder,
 79        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression,
 80        bool condition)
 81        where TEntity : class
 82    {
 2783        if (condition && !previousBuilder.IsChainDiscarded)
 84        {
 1785            var expr = new IncludeExpression(thenIncludeExpression, typeof(TEntity), typeof(TProperty), typeof(IEnumerab
 1786            previousBuilder.Specification.Add(expr);
 87        }
 88
 2789        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TProperty>(previousBuilder.Specification, !cond
 2790        return includeBuilder;
 91    }
 92}

Methods/Properties

ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`3<TEntity,TResult,TPreviousProperty>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>)
ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`3<TEntity,TResult,TPreviousProperty>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>,System.Boolean)
ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`2<TEntity,TPreviousProperty>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>)
ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`2<TEntity,TPreviousProperty>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>,System.Boolean)
ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`3<TEntity,TResult,System.Collections.Generic.IEnumerable`1<TPreviousProperty>>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>)
ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`3<TEntity,TResult,System.Collections.Generic.IEnumerable`1<TPreviousProperty>>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>,System.Boolean)
ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`2<TEntity,System.Collections.Generic.IEnumerable`1<TPreviousProperty>>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>)
ThenInclude(Pozitron.QuerySpecification.IIncludableSpecificationBuilder`2<TEntity,System.Collections.Generic.IEnumerable`1<TPreviousProperty>>,System.Linq.Expressions.Expression`1<System.Func`2<TPreviousProperty,TProperty>>,System.Boolean)