< Summary

Information
Class: Pozitron.QuerySpecification.IncludableBuilderExtensions
Assembly: Pozitron.QuerySpecification
File(s): /home/runner/work/QuerySpecification/QuerySpecification/src/QuerySpecification/Builders/IncludableBuilderExtensions.cs
Tag: 50_11685979511
Line coverage
100%
Covered lines: 24
Uncovered lines: 0
Coverable lines: 24
Total lines: 104
Line coverage: 100%
Branch coverage
100%
Covered branches: 16
Total branches: 16
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%44100%
ThenInclude(...)100%11100%
ThenInclude(...)100%44100%
ThenInclude(...)100%11100%
ThenInclude(...)100%44100%
ThenInclude(...)100%11100%
ThenInclude(...)100%44100%

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 && !Specification<TEntity, TResult>.IsChainDiscarded)
 18        {
 919            previousBuilder.Specification.AddInternal(ItemType.Include, thenIncludeExpression, (int)IncludeType.ThenIncl
 20        }
 21        else
 22        {
 1023            Specification<TEntity, TResult>.IsChainDiscarded = true;
 24        }
 25
 1926        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TResult, TProperty>(previousBuilder.Specificati
 1927        return includeBuilder;
 28    }
 29
 30    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 31        this IIncludableSpecificationBuilder<TEntity, TPreviousProperty> previousBuilder,
 32        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression)
 33        where TEntity : class
 2334        => ThenInclude(previousBuilder, thenIncludeExpression, true);
 35
 36    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 37        this IIncludableSpecificationBuilder<TEntity, TPreviousProperty> previousBuilder,
 38        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression,
 39        bool condition)
 40        where TEntity : class
 41    {
 2742        if (condition && !Specification<TEntity>.IsChainDiscarded)
 43        {
 1744            previousBuilder.Specification.AddInternal(ItemType.Include, thenIncludeExpression, (int)IncludeType.ThenIncl
 45        }
 46        else
 47        {
 1048            Specification<TEntity>.IsChainDiscarded = true;
 49        }
 50
 2751        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TProperty>(previousBuilder.Specification);
 2752        return includeBuilder;
 53    }
 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        where TEntity : class
 1459        => ThenInclude(previousBuilder, thenIncludeExpression, true);
 60
 61    public static IIncludableSpecificationBuilder<TEntity, TResult, TProperty> ThenInclude<TEntity, TResult, TPreviousPr
 62        this IIncludableSpecificationBuilder<TEntity, TResult, IEnumerable<TPreviousProperty>> previousBuilder,
 63        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression,
 64        bool condition)
 65        where TEntity : class
 66    {
 1867        if (condition && !Specification<TEntity, TResult>.IsChainDiscarded)
 68        {
 869            previousBuilder.Specification.AddInternal(ItemType.Include, thenIncludeExpression, (int)IncludeType.ThenIncl
 70        }
 71        else
 72        {
 1073            Specification<TEntity, TResult>.IsChainDiscarded = true;
 74        }
 75
 1876        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TResult, TProperty>(previousBuilder.Specificati
 1877        return includeBuilder;
 78    }
 79
 80    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 81        this IIncludableSpecificationBuilder<TEntity, IEnumerable<TPreviousProperty>> previousBuilder,
 82        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression)
 83        where TEntity : class
 2384        => ThenInclude(previousBuilder, thenIncludeExpression, true);
 85
 86    public static IIncludableSpecificationBuilder<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>
 87        this IIncludableSpecificationBuilder<TEntity, IEnumerable<TPreviousProperty>> previousBuilder,
 88        Expression<Func<TPreviousProperty, TProperty>> thenIncludeExpression,
 89        bool condition)
 90        where TEntity : class
 91    {
 2792        if (condition && !Specification<TEntity>.IsChainDiscarded)
 93        {
 1794            previousBuilder.Specification.AddInternal(ItemType.Include, thenIncludeExpression, (int)IncludeType.ThenIncl
 95        }
 96        else
 97        {
 1098            Specification<TEntity>.IsChainDiscarded = true;
 99        }
 100
 27101        var includeBuilder = new IncludableSpecificationBuilder<TEntity, TProperty>(previousBuilder.Specification);
 27102        return includeBuilder;
 103    }
 104}

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)