From 5f6e497061cc855c52383a2922b1663c8c5bbfaa Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 3 Oct 2024 12:31:13 +0000 Subject: [PATCH] Update coverage reports [skip ci] --- ...tyFrameworkCore_AsNoTrackingEvaluator.html | 4 +- ...ackingWithIdentityResolutionEvaluator.html | 4 +- ...tyFrameworkCore_AsSplitQueryEvaluator.html | 4 +- ...ityFrameworkCore_IQueryableExtensions.html | 4 +- ...eworkCore_IgnoreQueryFiltersEvaluator.html | 4 +- ....EntityFrameworkCore_IncludeEvaluator.html | 225 +++++++++--------- ...ion.EntityFrameworkCore_LikeEvaluator.html | 4 +- ...ion.EntityFrameworkCore_LikeExtension.html | 4 +- ...rameworkCore_ParameterReplacerVisitor.html | 4 +- ....EntityFrameworkCore_RepositoryBase_1.html | 4 +- ...yFrameworkCore_SpecificationEvaluator.html | 4 +- ...fication_ConcurrentSelectorsException.html | 4 +- ...Specification_EntityNotFoundException.html | 4 +- ...ification_IncludableBuilderExtensions.html | 4 +- ...tion_IncludableSpecificationBuilder_2.html | 4 +- ...tion_IncludableSpecificationBuilder_3.html | 4 +- ....QuerySpecification_IncludeExpression.html | 4 +- ...ification_InvalidLikePatternException.html | 4 +- ...n.QuerySpecification_LikeExpression_1.html | 4 +- ...tron.QuerySpecification_LikeExtension.html | 22 +- ...uerySpecification_LikeMemoryEvaluator.html | 4 +- ...tron.QuerySpecification_LikeValidator.html | 4 +- ...ron.QuerySpecification_OrderEvaluator.html | 4 +- ....QuerySpecification_OrderExpression_1.html | 4 +- ...pecification_OrderedBuilderExtensions.html | 4 +- ...ication_OrderedSpecificationBuilder_1.html | 4 +- ...ication_OrderedSpecificationBuilder_2.html | 4 +- ...tron.QuerySpecification_PagedResult_1.html | 4 +- Pozitron.QuerySpecification_Pagination.html | 4 +- ...erySpecification_PaginationExtensions.html | 4 +- ...QuerySpecification_PaginationSettings.html | 4 +- Pozitron.QuerySpecification_PagingFilter.html | 4 +- ...ecification_SelectorNotFoundException.html | 4 +- ...cation_SpecificationBuilderExtensions.html | 4 +- ...ySpecification_SpecificationBuilder_1.html | 4 +- ...ySpecification_SpecificationBuilder_2.html | 4 +- ...cation_SpecificationInMemoryEvaluator.html | 4 +- ...ySpecification_SpecificationValidator.html | 4 +- ...on.QuerySpecification_Specification_1.html | 4 +- ...on.QuerySpecification_Specification_2.html | 4 +- ...ron.QuerySpecification_WhereEvaluator.html | 4 +- ....QuerySpecification_WhereExpression_1.html | 4 +- ...ron.QuerySpecification_WhereValidator.html | 4 +- SummaryGithub.md | 24 +- badge_branchcoverage.svg | 2 +- badge_combined.svg | 2 +- badge_shieldsio_branchcoverage_blue.svg | 2 +- ...e_shieldsio_branchcoverage_brightgreen.svg | 2 +- badge_shieldsio_branchcoverage_green.svg | 2 +- badge_shieldsio_branchcoverage_lightgrey.svg | 2 +- badge_shieldsio_branchcoverage_orange.svg | 2 +- badge_shieldsio_branchcoverage_red.svg | 2 +- badge_shieldsio_branchcoverage_yellow.svg | 2 +- ...e_shieldsio_branchcoverage_yellowgreen.svg | 2 +- index.htm | 52 ++-- index.html | 52 ++-- main.js | 10 +- 57 files changed, 316 insertions(+), 253 deletions(-) diff --git a/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingEvaluator.html b/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingEvaluator.html index 7984471..8bb92a7 100644 --- a/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingEvaluator.html +++ b/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingEvaluator.html @@ -29,7 +29,7 @@

< Summary

Tag: -41_11160642427 +42_11161999112 @@ -143,7 +143,7 @@

Generated by: ReportGenerator 5.3.9.0
10/03/2024 - 10:54:20
GitHub | reportgenerator.io +

Methods/Properties

diff --git a/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingWithIdentityResolutionEvaluator.html b/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingWithIdentityResolutionEvaluator.html index 0da3db7..303ad8e 100644 --- a/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingWithIdentityResolutionEvaluator.html +++ b/Pozitron.QuerySpecification.EntityFrameworkCore_AsNoTrackingWithIdentityResolutionEvaluator.html @@ -29,7 +29,7 @@

< Summary

Tag: -41_11160642427 +42_11161999112
@@ -143,7 +143,7 @@

Generated by: ReportGenerator 5.3.9.0
10/03/2024 - 10:54:20
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/Pozitron.QuerySpecification.EntityFrameworkCore_AsSplitQueryEvaluator.html b/Pozitron.QuerySpecification.EntityFrameworkCore_AsSplitQueryEvaluator.html index eed9d6f..8d1b269 100644 --- a/Pozitron.QuerySpecification.EntityFrameworkCore_AsSplitQueryEvaluator.html +++ b/Pozitron.QuerySpecification.EntityFrameworkCore_AsSplitQueryEvaluator.html @@ -29,7 +29,7 @@

< Summary

Tag: -41_11160642427 +42_11161999112
@@ -143,7 +143,7 @@

Generated by: ReportGenerator 5.3.9.0
10/03/2024 - 10:54:20
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/Pozitron.QuerySpecification.EntityFrameworkCore_IQueryableExtensions.html b/Pozitron.QuerySpecification.EntityFrameworkCore_IQueryableExtensions.html index 7a7f3d2..71e7132 100644 --- a/Pozitron.QuerySpecification.EntityFrameworkCore_IQueryableExtensions.html +++ b/Pozitron.QuerySpecification.EntityFrameworkCore_IQueryableExtensions.html @@ -29,7 +29,7 @@

< Summary

Tag: -41_11160642427 +42_11161999112
@@ -175,7 +175,7 @@

Generated by: ReportGenerator 5.3.9.0
10/03/2024 - 10:54:20
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/Pozitron.QuerySpecification.EntityFrameworkCore_IgnoreQueryFiltersEvaluator.html b/Pozitron.QuerySpecification.EntityFrameworkCore_IgnoreQueryFiltersEvaluator.html index 1c0d7c0..afed2a5 100644 --- a/Pozitron.QuerySpecification.EntityFrameworkCore_IgnoreQueryFiltersEvaluator.html +++ b/Pozitron.QuerySpecification.EntityFrameworkCore_IgnoreQueryFiltersEvaluator.html @@ -29,7 +29,7 @@

< Summary

Tag: -41_11160642427 +42_11161999112
@@ -143,7 +143,7 @@

Generated by: ReportGenerator 5.3.9.0
10/03/2024 - 10:54:20
GitHub | reportgenerator.io

+

Methods/Properties

diff --git a/Pozitron.QuerySpecification.EntityFrameworkCore_IncludeEvaluator.html b/Pozitron.QuerySpecification.EntityFrameworkCore_IncludeEvaluator.html index 686952c..a40c148 100644 --- a/Pozitron.QuerySpecification.EntityFrameworkCore_IncludeEvaluator.html +++ b/Pozitron.QuerySpecification.EntityFrameworkCore_IncludeEvaluator.html @@ -29,7 +29,7 @@

< Summary

Tag: -41_11160642427 +42_11161999112
@@ -45,7 +45,7 @@

< Summary

- + @@ -53,15 +53,15 @@

< Summary

- + - + - +
Covered lines:3844
Uncovered lines:
Coverable lines:3844
Total lines:8996
Line coverage:100%100%
@@ -70,20 +70,20 @@

< Summary

Branch coverage
-
79%
+
100%
- + - + - +
Covered branches:1936
Total branches:2436
Branch coverage:79.1%100%
@@ -111,12 +111,12 @@

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage -.cctor()50%1010100% -.ctor()100%11100% -Evaluate(...)100%88100% -BuildInclude(...)100%11100% -BuildThenInclude(...)100%22100% -IsGenericEnumerable(...)100%44100% +.cctor()100%2222100% +.ctor()100%11100% +Evaluate(...)100%88100% +BuildInclude(...)100%11100% +BuildThenInclude(...)100%22100% +IsGenericEnumerable(...)100%44100%
@@ -126,108 +126,115 @@

#LineLine coverage - 1using System.Diagnostics;2using System.Reflection;34namespace Pozitron.QuerySpecification;56public class IncludeEvaluator : IEvaluator7{ - 18    private static readonly MethodInfo _includeMethodInfo = typeof(EntityFrameworkQueryableExtensions) - 19        .GetTypeInfo().GetDeclaredMethods(nameof(EntityFrameworkQueryableExtensions.Include)) - 310        .Single(mi => mi.IsPublic && mi.GetGenericArguments().Length == 2);11 - 112    private static readonly MethodInfo _thenIncludeAfterReferenceMethodInfo - 113        = typeof(EntityFrameworkQueryableExtensions) - 114            .GetTypeInfo().GetDeclaredMethods(nameof(EntityFrameworkQueryableExtensions.ThenInclude)) - 315            .Single(mi => mi.IsPublic && mi.GetGenericArguments().Length == 3 - 316                && mi.GetParameters()[0].ParameterType.GenericTypeArguments[1].IsGenericParameter);17 - 118    private static readonly MethodInfo _thenIncludeAfterEnumerableMethodInfo - 119        = typeof(EntityFrameworkQueryableExtensions) - 120            .GetTypeInfo().GetDeclaredMethods(nameof(EntityFrameworkQueryableExtensions.ThenInclude)) - 321            .Single(mi => mi.IsPublic && mi.GetGenericArguments().Length == 3 - 322                && !mi.GetParameters()[0].ParameterType.GenericTypeArguments[1].IsGenericParameter);23 - 224    private IncludeEvaluator() { } - 125    public static IncludeEvaluator Instance = new();2627    public IQueryable<T> Evaluate<T>(IQueryable<T> source, Specification<T> specification) where T : class28    { - 12029        foreach (var includeString in specification.IncludeStrings)30        { - 931            source = source.Include(includeString);32        }1using Microsoft.EntityFrameworkCore.Query;2using System.Diagnostics;3using System.Reflection;45namespace Pozitron.QuerySpecification;67public class IncludeEvaluator : IEvaluator8{ + 19    private static readonly MethodInfo _includeMethodInfo = typeof(EntityFrameworkQueryableExtensions) + 110        .GetTypeInfo().GetDeclaredMethods(nameof(EntityFrameworkQueryableExtensions.Include)) + 311        .Single(mi => mi.IsPublic && mi.GetGenericArguments().Length == 2 + 312            && mi.GetParameters()[0].ParameterType.GetGenericTypeDefinition() == typeof(IQueryable<>) + 313            && mi.GetParameters()[1].ParameterType.GetGenericTypeDefinition() == typeof(Expression<>));14 + 115    private static readonly MethodInfo _thenIncludeAfterReferenceMethodInfo + 116        = typeof(EntityFrameworkQueryableExtensions) + 117            .GetTypeInfo().GetDeclaredMethods(nameof(EntityFrameworkQueryableExtensions.ThenInclude)) + 318            .Single(mi => mi.IsPublic && mi.GetGenericArguments().Length == 3 + 319                && mi.GetParameters()[0].ParameterType.GenericTypeArguments[1].IsGenericParameter + 320                && mi.GetParameters()[0].ParameterType.GetGenericTypeDefinition() == typeof(IIncludableQueryable<,>) + 321                && mi.GetParameters()[1].ParameterType.GetGenericTypeDefinition() == typeof(Expression<>));22 + 123    private static readonly MethodInfo _thenIncludeAfterEnumerableMethodInfo + 124        = typeof(EntityFrameworkQueryableExtensions) + 125            .GetTypeInfo().GetDeclaredMethods(nameof(EntityFrameworkQueryableExtensions.ThenInclude)) + 326            .Single(mi => mi.IsPublic && mi.GetGenericArguments().Length == 3 + 327                && !mi.GetParameters()[0].ParameterType.GenericTypeArguments[1].IsGenericParameter + 328                && mi.GetParameters()[0].ParameterType.GetGenericTypeDefinition() == typeof(IIncludableQueryable<,>) + 329                && mi.GetParameters()[1].ParameterType.GetGenericTypeDefinition() == typeof(Expression<>));30 + 231    private IncludeEvaluator() { } + 132    public static IncludeEvaluator Instance = new();  33 - 22034        foreach (var includeExpression in specification.IncludeExpressions)35        { - 5936            if (includeExpression.Type == IncludeTypeEnum.Include)37            { - 2738                source = BuildInclude<T>(source, includeExpression);39            } - 3240            else if (includeExpression.Type == IncludeTypeEnum.ThenInclude)41            { - 3242                source = BuildThenInclude<T>(source, includeExpression);43            }44        }45 - 5146        return source;47    }4849    private static IQueryable<T> BuildInclude<T>(IQueryable source, IncludeExpression includeExpression)50    {51        Debug.Assert(includeExpression is not null);34    public IQueryable<T> Evaluate<T>(IQueryable<T> source, Specification<T> specification) where T : class35    { + 12036        foreach (var includeString in specification.IncludeStrings)37        { + 938            source = source.Include(includeString);39        }40 + 22041        foreach (var includeExpression in specification.IncludeExpressions)42        { + 5943            if (includeExpression.Type == IncludeTypeEnum.Include)44            { + 2745                source = BuildInclude<T>(source, includeExpression);46            } + 3247            else if (includeExpression.Type == IncludeTypeEnum.ThenInclude)48            { + 3249                source = BuildThenInclude<T>(source, includeExpression);50            }51        }  52 - 2753        var result = _includeMethodInfo - 2754            .MakeGenericMethod(includeExpression.EntityType, includeExpression.PropertyType) - 2755            .Invoke(null, [source, includeExpression.LambdaExpression]);5657        Debug.Assert(result is not null);58 - 2759        return (IQueryable<T>)result;60    }6162    private static IQueryable<T> BuildThenInclude<T>(IQueryable source, IncludeExpression includeExpression)63    {64        Debug.Assert(includeExpression is not null);65        Debug.Assert(includeExpression.PreviousPropertyType is not null);66 - 3267        var result = (IsGenericEnumerable(includeExpression.PreviousPropertyType, out var previousPropertyType) - 3268                            ? _thenIncludeAfterEnumerableMethodInfo - 3269                            : _thenIncludeAfterReferenceMethodInfo) - 3270            .MakeGenericMethod(includeExpression.EntityType, previousPropertyType, includeExpression.PropertyType) - 3271            .Invoke(null, [source, includeExpression.LambdaExpression]);7273        Debug.Assert(result is not null);74 - 3275        return (IQueryable<T>)result;76    }7778    private static bool IsGenericEnumerable(Type type, out Type propertyType)79    { - 3280        if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>))81        { - 1782            propertyType = type.GenericTypeArguments[0]; - 1783            return true;84        }85 - 1586        propertyType = type; - 1587        return false;88    }89} + 5153        return source;54    }5556    private static IQueryable<T> BuildInclude<T>(IQueryable source, IncludeExpression includeExpression)57    {58        Debug.Assert(includeExpression is not null);59 + 2760        var result = _includeMethodInfo + 2761            .MakeGenericMethod(includeExpression.EntityType, includeExpression.PropertyType) + 2762            .Invoke(null, [source, includeExpression.LambdaExpression]);6364        Debug.Assert(result is not null);65 + 2766        return (IQueryable<T>)result;67    }6869    private static IQueryable<T> BuildThenInclude<T>(IQueryable source, IncludeExpression includeExpression)70    {71        Debug.Assert(includeExpression is not null);72        Debug.Assert(includeExpression.PreviousPropertyType is not null);73 + 3274        var result = (IsGenericEnumerable(includeExpression.PreviousPropertyType, out var previousPropertyType) + 3275                            ? _thenIncludeAfterEnumerableMethodInfo + 3276                            : _thenIncludeAfterReferenceMethodInfo) + 3277            .MakeGenericMethod(includeExpression.EntityType, previousPropertyType, includeExpression.PropertyType) + 3278            .Invoke(null, [source, includeExpression.LambdaExpression]);7980        Debug.Assert(result is not null);81 + 3282        return (IQueryable<T>)result;83    }8485    private static bool IsGenericEnumerable(Type type, out Type propertyType)86    { + 3287        if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>))88        { + 1789            propertyType = type.GenericTypeArguments[0]; + 1790            return true;91        }92 + 1593        propertyType = type; + 1594        return false;95    }96}

- +