Skip to content

Commit

Permalink
update to 8.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Mar 25, 2024
1 parent a23e0ea commit efe5813
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
9 changes: 3 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<CommonVersion>1.0.60</CommonVersion>
<EFVersion>8.0.0</EFVersion>
<CommonVersion>1.0.63</CommonVersion>
<EFVersion>8.0.3</EFVersion>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -19,9 +19,6 @@
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryUrl>https://github.com/WeihanLi/WeihanLi.EntityFramework</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>Copyright 2019-2023 (c) WeihanLi</Copyright>
<Copyright>Copyright 2019-2024 (c) WeihanLi</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/version.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<VersionMajor>8</VersionMajor>
<VersionMinor>0</VersionMinor>
<VersionPatch>0</VersionPatch>
<VersionPatch>3</VersionPatch>
<VersionRevision></VersionRevision>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
<VersionSuffix Condition="'$(Configuration)'=='DEBUG'">preview</VersionSuffix>
Expand Down
22 changes: 11 additions & 11 deletions src/WeihanLi.EntityFramework/EFRepositoryQueryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using WeihanLi.Common;

namespace WeihanLi.EntityFramework;

Expand All @@ -20,7 +21,14 @@ public EFRepositoryQueryBuilder(DbSet<TEntity> dbSet)

public EFRepositoryQueryBuilder<TEntity> WithPredict(Expression<Func<TEntity, bool>> predict)
{
_whereExpression.Add(predict ?? throw new ArgumentNullException(nameof(predict)));
_whereExpression.Add(Guard.NotNull(predict));
return this;
}

public EFRepositoryQueryBuilder<TEntity> WithPredictIf(Expression<Func<TEntity, bool>> predict, bool condition)
{
if (condition)
_whereExpression.Add(Guard.NotNull(predict));
return this;
}

Expand Down Expand Up @@ -99,22 +107,14 @@ public IQueryable<TEntity> Build()

public IQueryable<TResult> Build<TResult>(Expression<Func<TEntity, TResult>> selector)
{
if (null == selector)
{
throw new ArgumentNullException(nameof(selector));
}

ArgumentNullException.ThrowIfNull(selector);
var query = Build();
return query.Select(selector);
}

public IQueryable<TResult> Build<TResult>(Expression<Func<TEntity, int, TResult>> selector)
{
if (null == selector)
{
throw new ArgumentNullException(nameof(selector));
}

ArgumentNullException.ThrowIfNull(selector);
var query = Build();
return query.Select(selector);
}
Expand Down

0 comments on commit efe5813

Please sign in to comment.