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:
@ -10,14 +10,17 @@ using System.Linq.Expressions;
|
||||
namespace FreeSql {
|
||||
partial class DbContext {
|
||||
|
||||
public long SaveChanges() {
|
||||
public int SaveChanges() {
|
||||
ExecCommand();
|
||||
_uow.Commit();
|
||||
return _affrows;
|
||||
_uow?.Commit();
|
||||
var ret = _affrows;
|
||||
_affrows = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Dictionary<Type, Dictionary<string, Func<object, object[], int>>> _dicExecCommandDbContextBetch = new Dictionary<Type, Dictionary<string, Func<object, object[], int>>>();
|
||||
internal void ExecCommand() {
|
||||
if (_actions.Any() == false) return;
|
||||
ExecCommandInfo oldinfo = null;
|
||||
var states = new List<object>();
|
||||
|
||||
|
Reference in New Issue
Block a user