Skip to content

Commit

Permalink
Merge pull request #7263 from olicooper/pr/ef-warn-tenant-repo-1
Browse files Browse the repository at this point in the history
Fix EF warning in EfCoreTenantRepository
  • Loading branch information
realLiangshiwei authored Jan 15, 2021
2 parents e26b961 + 70117d9 commit 0438eac
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public virtual async Task<Tenant> FindByNameAsync(
{
return await (await GetDbSetAsync())
.IncludeDetails(includeDetails)
.OrderBy(t => t.Id)
.FirstOrDefaultAsync(t => t.Name == name, GetCancellationToken(cancellationToken));
}

Expand All @@ -33,6 +34,7 @@ public virtual Tenant FindByName(string name, bool includeDetails = true)
{
return DbSet
.IncludeDetails(includeDetails)
.OrderBy(t => t.Id)
.FirstOrDefault(t => t.Name == name);
}

Expand All @@ -41,6 +43,7 @@ public virtual Tenant FindById(Guid id, bool includeDetails = true)
{
return DbSet
.IncludeDetails(includeDetails)
.OrderBy(t => t.Id)
.FirstOrDefault(t => t.Id == id);
}

Expand Down

0 comments on commit 0438eac

Please sign in to comment.