Skip to content

Commit

Permalink
package updates have been made.
Browse files Browse the repository at this point in the history
  • Loading branch information
byerlikaya committed Jan 22, 2024
1 parent 7b908aa commit 5be36e1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
8 changes: 4 additions & 4 deletions sample/Sample.Api/Sample.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

Expand Down
13 changes: 5 additions & 8 deletions src/SmartWhere/Attributes/WhereClauseAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
namespace SmartWhere.Attributes;

[AttributeUsage(AttributeTargets.Property)]
public class WhereClauseAttribute : Attribute
public class WhereClauseAttribute(string propertyName, LogicalOperator logicalOperator = LogicalOperator.AND)
: Attribute
{
public string PropertyName { get; set; }
public string PropertyName { get; set; } = propertyName;

public LogicalOperator LogicalOperator { get; set; }
public LogicalOperator LogicalOperator { get; set; } = logicalOperator;

public WhereClauseAttribute(LogicalOperator logicalOperator = LogicalOperator.AND) => LogicalOperator = logicalOperator;

public WhereClauseAttribute(string propertyName, LogicalOperator logicalOperator = LogicalOperator.AND)
public WhereClauseAttribute(LogicalOperator logicalOperator = LogicalOperator.AND) : this(null, logicalOperator)
{
PropertyName = propertyName;
LogicalOperator = logicalOperator;
}
}
2 changes: 1 addition & 1 deletion src/SmartWhere/Extensions/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal static List<PropertyInfo> GetWhereClauseProperties(
.ToList();

if (whereClauseProperties.IsNullOrNotAny())
return new List<PropertyInfo>();
return [];

valueData = whereClauseProperties.FirstOrDefault()!.GetValue(whereClauseDto);

Expand Down
6 changes: 3 additions & 3 deletions src/SmartWhere/SmartWhere.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

public static class SmartWhere
{
private static readonly List<Type> Types = new()
{
private static readonly List<Type> Types =
[
typeof(short),
typeof(int),
typeof(long),
Expand All @@ -18,7 +18,7 @@ public static class SmartWhere
typeof(bool?),
typeof(DateTime),
typeof(DateTime?)
};
];

public static IQueryable<T> Where<T>(this IQueryable<T> source, IWhereClause whereClauseDto)
{
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.0</Version>
<Version>2.2.0.1</Version>
<Authors>Barış Yerlikaya</Authors>
<Company>Barış Yerlikaya</Company>
<Product>SmartWhere</Product>
Expand Down
4 changes: 2 additions & 2 deletions tests/SmartWhere.Tests/SmartWhere.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 5be36e1

Please sign in to comment.