Browse Source

Add Obsolete

pull/14/MERGE
sunkaixuan 3 years ago
parent
commit
382f5262c9
  1. 2
      Src/Asp.Net/SqlServerTest/Demo/Demo8_Saveable.cs
  2. 4
      Src/Asp.Net/SqlSugar/SqlSugarClient.cs
  3. 4
      Src/Asp.Net/SqlSugar/SqlSugarScope.cs

2
Src/Asp.Net/SqlServerTest/Demo/Demo8_Saveable.cs

@ -30,6 +30,8 @@ namespace OrmTest
} }
}); });
//insert or update
var x1 = db.Storageable<Order>(new Order() { Id = 1, Name = "jack" }).ExecuteUpdateOrInsert();
//insert or update //insert or update
var x= db.Storageable<Order>(new Order() { Id=1, Name="jack" }).ToStorage(); var x= db.Storageable<Order>(new Order() { Id=1, Name="jack" }).ToStorage();

4
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() "); Check.Exception(typeof(T).FullName.Contains("System.Collections.Generic.List`"), " need where T: class, new() ");
return this.Context.Storageable(new List<T> { data}); return this.Context.Storageable(new List<T> { data});
} }
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new() public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new()
{ {
return this.Context.Saveable<T>(saveObjects); return this.Context.Saveable<T>(saveObjects);
} }
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(T saveObject) where T : class, new() public ISaveable<T> Saveable<T>(T saveObject) where T : class, new()
{ {
return this.Context.Saveable(saveObject); return this.Context.Saveable(saveObject);

4
Src/Asp.Net/SqlSugar/SqlSugarScope.cs

@ -436,11 +436,13 @@ namespace SqlSugar
ScopedContext.RollbackTran(); ScopedContext.RollbackTran();
} }
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new() public ISaveable<T> Saveable<T>(List<T> saveObjects) where T : class, new()
{ {
return ScopedContext.Saveable(saveObjects); return ScopedContext.Saveable(saveObjects);
} }
[Obsolete("use Storageable")]
public ISaveable<T> Saveable<T>(T saveObject) where T : class, new() public ISaveable<T> Saveable<T>(T saveObject) where T : class, new()
{ {
return ScopedContext.Saveable(saveObject); return ScopedContext.Saveable(saveObject);

Loading…
Cancel
Save