Skip to content

Commit

Permalink
Merge pull request #9988 from git102347501/patch-3
Browse files Browse the repository at this point in the history
Update Dapper.md
  • Loading branch information
maliming committed Sep 9, 2021
2 parents d5c7e6b + ae8b4aa commit 9386c67
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/en/Dapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ public class PersonDapperRepository : DapperRepository<MyAppDbContext>, ITransie

public virtual async Task<List<string>> GetAllPersonNames()
{
return (await DbConnection.QueryAsync<string>("select Name from People", transaction: DbTransaction))
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)
{
return await DbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name },
DbTransaction);
var dbConnection = await GetDbConnectionAsync();
return await dbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name },
await GetDbTransactionAsync());
}
}
```

0 comments on commit 9386c67

Please sign in to comment.