diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo8_Saveable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo8_Saveable.cs index 82c44f685..7a85f1f72 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo8_Saveable.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo8_Saveable.cs @@ -30,6 +30,8 @@ namespace OrmTest } }); + //insert or update + var x1 = db.Storageable(new Order() { Id = 1, Name = "jack" }).ExecuteUpdateOrInsert(); //insert or update var x= db.Storageable(new Order() { Id=1, Name="jack" }).ToStorage(); diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index a743ffb1a..03744c06b 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs @@ -360,11 +360,13 @@ namespace SqlSugar Check.Exception(typeof(T).FullName.Contains("System.Collections.Generic.List`"), " need where T: class, new() "); return this.Context.Storageable(new List { data}); } + + [Obsolete("use Storageable")] public ISaveable Saveable(List saveObjects) where T : class, new() { return this.Context.Saveable(saveObjects); } - + [Obsolete("use Storageable")] public ISaveable Saveable(T saveObject) where T : class, new() { return this.Context.Saveable(saveObject); diff --git a/Src/Asp.Net/SqlSugar/SqlSugarScope.cs b/Src/Asp.Net/SqlSugar/SqlSugarScope.cs index a2b372d97..1db7cb3fe 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarScope.cs +++ b/Src/Asp.Net/SqlSugar/SqlSugarScope.cs @@ -436,11 +436,13 @@ namespace SqlSugar ScopedContext.RollbackTran(); } + + [Obsolete("use Storageable")] public ISaveable Saveable(List saveObjects) where T : class, new() { return ScopedContext.Saveable(saveObjects); } - + [Obsolete("use Storageable")] public ISaveable Saveable(T saveObject) where T : class, new() { return ScopedContext.Saveable(saveObject);