Browse Source

Update Dapper.md

pull/9988/head
maliming 4 years ago
committed by GitHub
parent
commit
ae8b4aac10
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      docs/en/Dapper.md

8
docs/en/Dapper.md

@ -53,15 +53,15 @@ public class PersonDapperRepository : DapperRepository<MyAppDbContext>, ITransie
public virtual async Task<List<string>> GetAllPersonNames()
{
var dbContext = await GetDbConnectionAsync();
return (await dbContext.QueryAsync<string>("select Name from People", transaction: await GetDbTransactionAsync()))
var dbConnection = await GetDbConnectionAsync();
return (await dbConnection.QueryAsync<string>("select Name from People", transaction: await GetDbTransactionAsync()))
.ToList();
}
public virtual async Task<int> UpdatePersonNames(string name)
{
var dbContext = await GetDbConnectionAsync();
return await dbContext.ExecuteAsync("update People set Name = @NewName", new { NewName = name },
var dbConnection = await GetDbConnectionAsync();
return await dbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name },
await GetDbTransactionAsync());
}
}

Loading…
Cancel
Save