mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
FreeSql.DbContext 融合 Repository + UnitOfWork
This commit is contained in:
@ -11,14 +11,17 @@ using System.Threading.Tasks;
|
||||
namespace FreeSql {
|
||||
partial class DbContext {
|
||||
|
||||
async public Task<long> SaveChangesAsync() {
|
||||
async public Task<int> SaveChangesAsync() {
|
||||
await ExecCommandAsync();
|
||||
_uow.Commit();
|
||||
return _affrows;
|
||||
_uow?.Commit();
|
||||
var ret = _affrows;
|
||||
_affrows = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Dictionary<Type, Dictionary<string, Func<object, object[], Task<int>>>> _dicExecCommandDbContextBetchAsync = new Dictionary<Type, Dictionary<string, Func<object, object[], Task<int>>>>();
|
||||
async internal Task ExecCommandAsync() {
|
||||
if (_actions.Any() == false) return;
|
||||
ExecCommandInfo oldinfo = null;
|
||||
var states = new List<object>();
|
||||
|
||||
|
Reference in New Issue
Block a user