Skip to content

Commit

Permalink
Merge pull request #12 from byerlikaya/bugfix_and_package_update
Browse files Browse the repository at this point in the history
Bugfix and package update
  • Loading branch information
byerlikaya authored Jul 10, 2024
2 parents 88772b0 + f5e99ed commit 26859cd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
10 changes: 5 additions & 5 deletions sample/Sample.Api/Sample.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.1" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 1 addition & 6 deletions src/SmartWhere/SmartWhere.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static IQueryable<T> Where<T>(this IQueryable<T> 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;
Expand Down Expand Up @@ -195,7 +195,6 @@ private static Expression ComplexComparison<T>(

foreach (var (propertyInfo, propertyType) in properties)
{

if (!propertyType.Namespace!.StartsWith("System") ||
propertyInfo.PropertyType!.IsEnumarableType())
{
Expand Down Expand Up @@ -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)
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/SmartWhere/SmartWhere.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>SmartWhere</PackageId>
<Version>2.2.1</Version>
<Version>2.2.2</Version>
<Authors>Barış Yerlikaya</Authors>
<Company>Barış Yerlikaya</Company>
<Product>SmartWhere</Product>
Expand Down
6 changes: 3 additions & 3 deletions tests/SmartWhere.Tests/SmartWhere.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 26859cd

Please sign in to comment.