Browse Source

Update Repositories.md

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

3
docs/zh-Hans/Repositories.md

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

Loading…
Cancel
Save