mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Support InserableUseparameter
This commit is contained in:
parent
7e7d6ba95d
commit
aec80e8d70
@ -89,7 +89,7 @@ namespace OrmTest
|
||||
}
|
||||
}
|
||||
})
|
||||
.AddSubList(it => it.Items.First().OrderId).ExecuteReturnPrimaryKey();
|
||||
.AddSubList(it => it.Items.First().OrderId).ExecuteCommand();
|
||||
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ namespace OrmTest
|
||||
}
|
||||
})
|
||||
.AddSubList(it => it.TwoItem3)
|
||||
.ExecuteReturnPrimaryKey();
|
||||
.ExecuteCommand();
|
||||
|
||||
SubNoIdentity(db);
|
||||
SubIdentity(db);
|
||||
|
@ -225,6 +225,13 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Setting
|
||||
|
||||
public IParameterInsertable<T> UseParameter()
|
||||
{
|
||||
var result = new ParameterInsertable<T>();
|
||||
result.Inserable = this;
|
||||
return result;
|
||||
}
|
||||
public IInsertable<T> AS(string tableName)
|
||||
{
|
||||
if (tableName == null) return this;
|
||||
@ -768,6 +775,7 @@ namespace SqlSugar
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SqlSugar
|
||||
{
|
||||
public class ParameterInsertable<T> : IParameterInsertable<T> where T:class,new()
|
||||
{
|
||||
public InsertableProvider<T> Inserable { get; set; }
|
||||
public int ExecuteCommand()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
7
Src/Asp.Net/SqlSugar/Interface/IParameterInsertable.cs
Normal file
7
Src/Asp.Net/SqlSugar/Interface/IParameterInsertable.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace SqlSugar
|
||||
{
|
||||
public interface IParameterInsertable<T>
|
||||
{
|
||||
InsertableProvider<T> Inserable { get; set; }
|
||||
}
|
||||
}
|
@ -35,7 +35,7 @@ namespace SqlSugar
|
||||
|
||||
ISubInsertable<T> AddSubList(Expression<Func<T, object>> subForeignKey);
|
||||
ISubInsertable<T> AddSubList(Expression<Func<T, SubInsertTree>> tree);
|
||||
|
||||
IParameterInsertable<T> UseParameter();
|
||||
IInsertable<T> CallEntityMethod(Expression<Action<T>> method);
|
||||
|
||||
IInsertable<T> EnableDiffLogEvent(object businessData = null);
|
||||
|
@ -88,6 +88,8 @@
|
||||
<Compile Include="Abstract\FilterProvider\FilterProvider.cs" />
|
||||
<Compile Include="Abstract\InsertableProvider\InsertableProvider.cs" />
|
||||
<Compile Include="Abstract\DeleteProvider\DeleteableProvider.cs" />
|
||||
<Compile Include="Interface\IParameterInsertable.cs" />
|
||||
<Compile Include="Abstract\InsertableProvider\ParameterInsertable.cs" />
|
||||
<Compile Include="Abstract\Reportable\ReportableProvider.cs" />
|
||||
<Compile Include="Abstract\SaveableProvider\Storageable.cs" />
|
||||
<Compile Include="DistributedSystem\Snowflake\SnowFlakeSingle.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user