mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 12:33:44 +08:00
Delete nav
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SqlSugar
|
||||||
|
{
|
||||||
|
public partial class DeleteNavProvider<Root, T> where T : class, new() where Root : class, new()
|
||||||
|
{
|
||||||
|
private void DeleteManyToMany<TChild>(string name, EntityColumnInfo nav) where TChild : class, new()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SqlSugar
|
||||||
|
{
|
||||||
|
public partial class DeleteNavProvider<Root, T> where T : class, new() where Root : class, new()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
private void DeleteOneToMany<TChild>(string name, EntityColumnInfo nav) where TChild : class, new()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SqlSugar
|
||||||
|
{
|
||||||
|
public partial class DeleteNavProvider<Root, T> where T : class, new() where Root : class, new()
|
||||||
|
{
|
||||||
|
private void DeleteOneToOne<TChild>(string name, EntityColumnInfo nav) where TChild : class, new()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -7,15 +7,39 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace SqlSugar
|
namespace SqlSugar
|
||||||
{
|
{
|
||||||
public class DeleteNavProvider<Root, T> where T : class, new() where Root : class, new()
|
public partial class DeleteNavProvider<Root, T> where T : class, new() where Root : class, new()
|
||||||
{
|
{
|
||||||
public SqlSugarProvider _Context { get; internal set; }
|
public List<Root> _Roots { get; set; }
|
||||||
|
public List<object> _ParentList { get; set; }
|
||||||
|
public List<object> _RootList { get; set; }
|
||||||
|
public EntityInfo _ParentEntity { get; set; }
|
||||||
|
public EntityColumnInfo _ParentPkColumn { get; set; }
|
||||||
|
public SqlSugarProvider _Context { get; set; }
|
||||||
|
|
||||||
public DeleteNavTask<Root, TChild> ThenInclude< TChild>(Expression<Func<Root, TChild>> expression)
|
public DeleteNavTask<Root, TChild> ThenInclude< TChild>(Expression<Func<Root, TChild>> expression)
|
||||||
where TChild : class, new()
|
where TChild : class, new()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
var name = ExpressionTool.GetMemberName(expression);
|
||||||
|
var nav = this._ParentEntity.Columns.FirstOrDefault(x => x.PropertyName == name);
|
||||||
|
if (nav.Navigat == null)
|
||||||
|
{
|
||||||
|
Check.ExceptionEasy($"{name} no navigate attribute", $"{this._ParentEntity.EntityName}的属性{name}没有导航属性");
|
||||||
}
|
}
|
||||||
|
if (nav.Navigat.NavigatType == NavigateType.OneToOne || nav.Navigat.NavigatType == NavigateType.ManyToOne)
|
||||||
|
{
|
||||||
|
DeleteOneToOne<TChild>(name, nav);
|
||||||
|
}
|
||||||
|
else if (nav.Navigat.NavigatType == NavigateType.OneToMany)
|
||||||
|
{
|
||||||
|
DeleteOneToMany<TChild>(name, nav);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DeleteManyToMany<TChild>(name, nav);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public DeleteNavTask<Root, TChild> ThenInclude<TChild>(Expression<Func<Root, List<TChild>>> expression)
|
public DeleteNavTask<Root, TChild> ThenInclude<TChild>(Expression<Func<Root, List<TChild>>> expression)
|
||||||
where TChild : class, new()
|
where TChild : class, new()
|
||||||
{
|
{
|
||||||
|
@@ -89,6 +89,9 @@
|
|||||||
<Compile Include="Abstract\DeleteProvider\SplitTableDeleteByObjectProvider.cs" />
|
<Compile Include="Abstract\DeleteProvider\SplitTableDeleteByObjectProvider.cs" />
|
||||||
<Compile Include="Abstract\DeleteProvider\SplitTableDeleteProvider.cs" />
|
<Compile Include="Abstract\DeleteProvider\SplitTableDeleteProvider.cs" />
|
||||||
<Compile Include="Abstract\EntityMaintenance\EntityMaintenance.cs" />
|
<Compile Include="Abstract\EntityMaintenance\EntityMaintenance.cs" />
|
||||||
|
<Compile Include="Abstract\ExecuteNavProvider\DeleteNavManyToMany.cs" />
|
||||||
|
<Compile Include="Abstract\ExecuteNavProvider\DeleteNavOneToMany.cs" />
|
||||||
|
<Compile Include="Abstract\ExecuteNavProvider\DeleteNavOneToOne.cs" />
|
||||||
<Compile Include="Abstract\ExecuteNavProvider\DeleteNavProvider.cs" />
|
<Compile Include="Abstract\ExecuteNavProvider\DeleteNavProvider.cs" />
|
||||||
<Compile Include="Abstract\ExecuteNavProvider\InsertNavProviderHelper.cs" />
|
<Compile Include="Abstract\ExecuteNavProvider\InsertNavProviderHelper.cs" />
|
||||||
<Compile Include="Abstract\ExecuteNavProvider\InsertNavProviderOneToMany.cs" />
|
<Compile Include="Abstract\ExecuteNavProvider\InsertNavProviderOneToMany.cs" />
|
||||||
|
Reference in New Issue
Block a user