mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Add InsertNav(+2)
This commit is contained in:
@@ -9,7 +9,7 @@ namespace SqlSugar
|
||||
{
|
||||
public partial class InsertNavProvider<Root,T> where T : class,new() where Root:class,new()
|
||||
{
|
||||
|
||||
public InsertNavRootOptions _RootOptions { get; set; }
|
||||
public List<Root> _Roots { get; set; }
|
||||
public List<object> _ParentList { get; set; }
|
||||
public List<object> _RootList { get; set; }
|
||||
|
@@ -905,6 +905,20 @@ namespace SqlSugar
|
||||
result.insertNavProvider = provider;
|
||||
return result;
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(T data, InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return InsertNav(new List<T>() { data },rootOptions); ;
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(List<T> datas, InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
var result = new InsertNavTaskInit<T, T>();
|
||||
var provider = new InsertNavProvider<T, T>();
|
||||
provider._Roots = datas;
|
||||
provider._Context = this;
|
||||
provider._RootOptions = rootOptions;
|
||||
result.insertNavProvider = provider;
|
||||
return result;
|
||||
}
|
||||
public DeleteNavTaskInit<T, T> DeleteNav<T>(T data) where T : class, new()
|
||||
{
|
||||
return DeleteNav(new List<T>() { data });
|
||||
|
@@ -689,6 +689,14 @@ namespace SqlSugar
|
||||
{
|
||||
return ScopedContext.InsertNav(datas);
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(T data,InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return ScopedContext.InsertNav(data,rootOptions);
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(List<T> datas, InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return ScopedContext.InsertNav(datas,rootOptions);
|
||||
}
|
||||
public DeleteNavTaskInit<T, T> DeleteNav<T>(T data) where T : class, new()
|
||||
{
|
||||
return ScopedContext.DeleteNav(data);
|
||||
|
@@ -17,6 +17,11 @@ namespace SqlSugar
|
||||
public string IgnoreColumns { get; set; }
|
||||
public string[] UpdateColumns { get; set; }
|
||||
}
|
||||
public class InertNavRootOptions
|
||||
{
|
||||
public string IgnoreColumns { get; set; }
|
||||
public string[] InsertColumns { get; set; }
|
||||
}
|
||||
public class UpdateNavRootOptions
|
||||
{
|
||||
public string IgnoreColumns { get; set; }
|
||||
|
@@ -209,6 +209,8 @@ namespace SqlSugar
|
||||
#region Nav CUD
|
||||
InsertNavTaskInit<T, T> InsertNav<T>(T data) where T : class, new();
|
||||
InsertNavTaskInit<T, T> InsertNav<T>(List<T> datas) where T : class, new();
|
||||
InsertNavTaskInit<T, T> InsertNav<T>(T data,InsertNavRootOptions rootOptions) where T : class, new();
|
||||
InsertNavTaskInit<T, T> InsertNav<T>(List<T> datas, InsertNavRootOptions rootOptions) where T : class, new();
|
||||
DeleteNavTaskInit<T, T> DeleteNav<T>(T data) where T : class, new();
|
||||
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();
|
||||
|
@@ -198,6 +198,14 @@ namespace SqlSugar
|
||||
{
|
||||
return this.Context.InsertNav(datas);
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(T data, InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return this.Context.InsertNav(data, rootOptions);
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(List<T> datas, InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return this.Context.InsertNav(datas, rootOptions);
|
||||
}
|
||||
public DeleteNavTaskInit<T, T> DeleteNav<T>(T data) where T : class, new()
|
||||
{
|
||||
return this.Context.DeleteNav(data);
|
||||
|
@@ -745,6 +745,14 @@ namespace SqlSugar
|
||||
{
|
||||
return ScopedContext.InsertNav(datas);
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(T data, InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return ScopedContext.InsertNav(data, rootOptions);
|
||||
}
|
||||
public InsertNavTaskInit<T, T> InsertNav<T>(List<T> datas, InsertNavRootOptions rootOptions) where T : class, new()
|
||||
{
|
||||
return ScopedContext.InsertNav(datas, rootOptions);
|
||||
}
|
||||
public DeleteNavTaskInit<T, T> DeleteNav<T>(T data) where T : class, new()
|
||||
{
|
||||
return ScopedContext.DeleteNav(data);
|
||||
|
Reference in New Issue
Block a user