Skip to content

Commit

Permalink
update package
Browse files Browse the repository at this point in the history
  • Loading branch information
thoo0224 committed May 1, 2022
1 parent 957ed2a commit 3207476
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/EfCore.Repository.Core/EfCore.Repository.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RepositoryUrl>https://github.com/thoo0224/EfCore.Repository</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Thoo.EfCore.Repository.Core</PackageId>
<Version>1.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/EfCore.Repository/EfCore.Repository.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Description>.NET 6 Repository librart for Entity Framework Core</Description>
<Description>.NET 6 Repository library for Entity Framework Core</Description>
<PackageProjectUrl>https://github.com/thoo0224/EfCore.Repository</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/thoo0224/EfCore.Repository</RepositoryUrl>
<PackageTags>Entity Framework, Entity Framework Core, Repository, EFCore</PackageTags>
<NeutralLanguage>en</NeutralLanguage>
<PackageId>Thoo.EfCore.Repository</PackageId>
<Version>1.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions src/EfCore.Repository/ReadOnlyRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ public ReadOnlyRepository(DbContext dbContext)
DbSet = DbContext.Set<TEntity>();
}

public IQueryable<TEntity> GetAll(bool tracking = true)
public IQueryable<TEntity> GetAll(bool tracking = false)
=> DbSet.AsQueryable().AsNoTracking();

public async Task<TEntity> FindAsync(Expression<Func<TEntity, bool>> expression, bool tracking = true)
public async Task<TEntity> FindAsync(Expression<Func<TEntity, bool>> expression, bool tracking = false)
{
var entity = await GetAll(tracking).FirstOrDefaultAsync(expression)
var entity = await GetAll(tracking)
.FirstOrDefaultAsync(expression)
.ConfigureAwait(false);

return entity;
Expand Down

0 comments on commit 3207476

Please sign in to comment.