Browse Source

Update Repositories.md

pull/11518/head
MagicalConch 4 years ago
committed by GitHub
parent
commit
882cde7734
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/zh-Hans/Repositories.md

4
docs/zh-Hans/Repositories.md

@ -118,8 +118,8 @@ public class PersonRepository : EfCoreRepository<MyDbContext, Person, Guid>, IPe
public async Task<Person> FindByNameAsync(string name)
{
var dbcontext = await GetDbContextAsync();
return await dbcontext.Set<Person>()
var dbContext = await GetDbContextAsync();
return await dbContext.Set<Person>()
.Where(p => p.Name == name)
.FirstOrDefaultAsync();
}

Loading…
Cancel
Save