mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-03 11:54:00 +08:00
Add db.UpdateNav(+2)
This commit is contained in:
@@ -9,7 +9,7 @@ namespace SqlSugar
|
||||
{
|
||||
public partial class UpdateNavProvider<Root, T> where T : class, new() where Root : class, new()
|
||||
{
|
||||
|
||||
internal UpdateNavRootOptions _RootOptions { get; set; }
|
||||
public List<Root> _Roots { get; set; }
|
||||
public List<object> _ParentList { get; set; }
|
||||
public List<object> _RootList { get; set; }
|
||||
|
||||
@@ -934,6 +934,20 @@ namespace SqlSugar
|
||||
result.UpdateNavProvider = provider;
|
||||
return result;
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(T data, UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return UpdateNav(new List<T>() { data},rootOptions);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas, UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
var result = new UpdateNavTaskInit<T, T>();
|
||||
var provider = new UpdateNavProvider<T, T>();
|
||||
provider._Roots = datas;
|
||||
provider._RootOptions = rootOptions;
|
||||
provider._Context = this;
|
||||
result.UpdateNavProvider = provider;
|
||||
return result; ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region DbFirst
|
||||
|
||||
@@ -709,6 +709,14 @@ namespace SqlSugar
|
||||
{
|
||||
return ScopedContext.UpdateNav(datas);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas, UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return this.ScopedContext.UpdateNav(datas, rootOptions);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(T data, UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return this.ScopedContext.UpdateNav(data, rootOptions);
|
||||
}
|
||||
public SqlSugarClient CopyNew()
|
||||
{
|
||||
return new SqlSugarClient(UtilMethods.CopyConfig(this.Ado.Context.CurrentConnectionConfig));
|
||||
|
||||
@@ -5,13 +5,24 @@ using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class DeleteNavOptions
|
||||
{
|
||||
public bool ManyToManyIsDeleteA { get; set; }
|
||||
public bool ManyToManyIsDeleteB { get; set; }
|
||||
}
|
||||
}
|
||||
public class InsertNavRootOptions
|
||||
{
|
||||
public string IgnoreColumns { get; set; }
|
||||
public string[] UpdateColumns { get; set; }
|
||||
}
|
||||
public class UpdateNavRootOptions
|
||||
{
|
||||
public string IgnoreColumns { get; set; }
|
||||
public string[] UpdateColumns { get; set; }
|
||||
public bool IsInsert { get; set; }
|
||||
}
|
||||
public class UpdateNavOptions
|
||||
{
|
||||
public bool ManyToManyIsUpdateA { get; set; }
|
||||
|
||||
@@ -213,7 +213,9 @@ namespace SqlSugar
|
||||
DeleteNavTaskInit<T, T> DeleteNav<T>(List<T> datas) where T : class, new();
|
||||
DeleteNavTaskInit<T, T> DeleteNav<T>(Expression<Func<T,bool>> whereExpression) where T : class, new();
|
||||
UpdateNavTaskInit<T, T> UpdateNav<T>(T data) where T : class, new ();
|
||||
UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas) where T : class, new ();
|
||||
UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas) where T : class, new ();
|
||||
UpdateNavTaskInit<T, T> UpdateNav<T>(T data,UpdateNavRootOptions rootOptions) where T : class, new();
|
||||
UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas, UpdateNavRootOptions rootOptions) where T : class, new();
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -214,9 +214,17 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.UpdateNav(data);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas,UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return this.Context.UpdateNav(datas, rootOptions);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(T data, UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return this.Context.UpdateNav(data,rootOptions);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas) where T : class, new()
|
||||
{
|
||||
return this.Context.UpdateNav(datas);
|
||||
return this.Context.UpdateNav(datas);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -765,6 +765,14 @@ namespace SqlSugar
|
||||
{
|
||||
return ScopedContext.UpdateNav(datas);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(T data,UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return ScopedContext.UpdateNav(data);
|
||||
}
|
||||
public UpdateNavTaskInit<T, T> UpdateNav<T>(List<T> datas, UpdateNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return ScopedContext.UpdateNav(datas);
|
||||
}
|
||||
public SqlSugarClient CopyNew()
|
||||
{
|
||||
return new SqlSugarClient(UtilMethods.CopyConfig(this.Ado.Context.CurrentConnectionConfig));
|
||||
|
||||
Reference in New Issue
Block a user