From 8522910b27129758550f0b41194773da5b827db3 Mon Sep 17 00:00:00 2001 From: Baris Yerlikaya Date: Wed, 10 Jul 2024 16:59:44 +0300 Subject: [PATCH 1/3] packages updated. --- sample/Sample.Api/Sample.Api.csproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sample/Sample.Api/Sample.Api.csproj b/sample/Sample.Api/Sample.Api.csproj index e9da122..118a418 100644 --- a/sample/Sample.Api/Sample.Api.csproj +++ b/sample/Sample.Api/Sample.Api.csproj @@ -6,11 +6,11 @@ - - - - - + + + + + From 14d143e7cbe341520d75b42a5cf81436ccab761d Mon Sep 17 00:00:00 2001 From: Baris Yerlikaya Date: Wed, 10 Jul 2024 16:59:58 +0300 Subject: [PATCH 2/3] packages updated. --- tests/SmartWhere.Tests/SmartWhere.Test.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/SmartWhere.Tests/SmartWhere.Test.csproj b/tests/SmartWhere.Tests/SmartWhere.Test.csproj index c276328..876a622 100644 --- a/tests/SmartWhere.Tests/SmartWhere.Test.csproj +++ b/tests/SmartWhere.Tests/SmartWhere.Test.csproj @@ -8,9 +8,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all From f5e99ed44f26eb4cef8384a2451197d7e02130e7 Mon Sep 17 00:00:00 2001 From: Baris Yerlikaya Date: Wed, 10 Jul 2024 17:01:37 +0300 Subject: [PATCH 3/3] Fixed a bug for classes that are sent as null. --- src/SmartWhere/SmartWhere.cs | 7 +------ src/SmartWhere/SmartWhere.csproj | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/SmartWhere/SmartWhere.cs b/src/SmartWhere/SmartWhere.cs index 923edda..26ca4dc 100644 --- a/src/SmartWhere/SmartWhere.cs +++ b/src/SmartWhere/SmartWhere.cs @@ -24,7 +24,7 @@ public static IQueryable Where(this IQueryable source, IWhereClause whe { var whereClauseProperties = whereClauseDto.GetWhereClauseProperties(out var valueData); - if (whereClauseProperties.IsNullOrNotAny()) + if (whereClauseProperties.IsNullOrNotAny() || valueData.IsNull()) return source.Where(x => true); Expression comparison = null; @@ -195,7 +195,6 @@ private static Expression ComplexComparison( foreach (var (propertyInfo, propertyType) in properties) { - if (!propertyType.Namespace!.StartsWith("System") || propertyInfo.PropertyType!.IsEnumarableType()) { @@ -290,9 +289,7 @@ private static MemberExpression SetLastMember( Expression parameterExpression) { if (lastMember.IsNull()) - { return Expression.Property(baseParameter, propertyInfo.Name); - } return currentType.IsEnumarableType() ? Expression.MakeMemberAccess(parameterExpression, propertyInfo) @@ -312,9 +309,7 @@ private static ParameterExpression SetParameterExpression( ParameterExpression parameterExpression) { if (currentType.IsEnumarableType()) - { return Expression.Parameter(type!, type!.Name.ToLower()); - } return parameterExpression.IsNull() ? Expression.Parameter(type, type.Name.ToLower()) diff --git a/src/SmartWhere/SmartWhere.csproj b/src/SmartWhere/SmartWhere.csproj index b11db03..5016363 100644 --- a/src/SmartWhere/SmartWhere.csproj +++ b/src/SmartWhere/SmartWhere.csproj @@ -2,7 +2,7 @@ SmartWhere - 2.2.1 + 2.2.2 Barış Yerlikaya Barış Yerlikaya SmartWhere