Browse Source

Add db.InsertByObject

pull/30/head
sunkaixuan 2 years ago
parent
commit
65f07efe44
  1. 10
      Src/Asp.NetCore2/SqlSugar/Abstract/InsertableProvider/InsertMethodInfo.cs
  2. 5
      Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs
  3. 5
      Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarScopeProvider.cs
  4. 1
      Src/Asp.NetCore2/SqlSugar/Interface/ISqlSugarClient.cs
  5. 4
      Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs
  6. 5
      Src/Asp.NetCore2/SqlSugar/SqlSugarScope.cs

10
Src/Asp.NetCore2/SqlSugar/Abstract/InsertableProvider/InsertMethodInfo.cs

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SqlSugar
{
public class InsertMethodInfo
{
}
}

5
Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarProvider.cs

@ -675,6 +675,11 @@ namespace SqlSugar
#endregion
#region Insertable
public InsertMethodInfo InsertableByObject(object singleEntityObjectOrListObject)
{
InsertMethodInfo result = new InsertMethodInfo();
return result;
}
public virtual IInsertable<T> Insertable<T>(T[] insertObjs) where T : class, new()
{
UtilMethods.CheckArray(insertObjs);

5
Src/Asp.NetCore2/SqlSugar/Abstract/SugarProvider/SqlSugarScopeProvider.cs

@ -215,7 +215,10 @@ namespace SqlSugar
{
ScopedContext.InitMappingInfo<T>();
}
public InsertMethodInfo InsertableByObject(object singleEntityObjectOrListObject)
{
return ScopedContext.InsertableByObject(singleEntityObjectOrListObject);
}
public IInsertable<T> Insertable<T>(Dictionary<string, object> columnDictionary) where T : class, new()
{
return ScopedContext.Insertable<T>(columnDictionary);

1
Src/Asp.NetCore2/SqlSugar/Interface/ISqlSugarClient.cs

@ -70,6 +70,7 @@ namespace SqlSugar
IInsertable<T> Insertable<T>(List<T> insertObjs) where T : class, new();
IInsertable<T> Insertable<T>(T insertObj) where T : class, new();
IInsertable<T> Insertable<T>(T[] insertObjs) where T : class, new();
InsertMethodInfo InsertableByObject(object singleEntityObjectOrListObject);
#endregion
#region Queryable

4
Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs

@ -159,6 +159,10 @@ namespace SqlSugar
#endregion
#region Insertable
public InsertMethodInfo InsertableByObject(object singleEntityObjectOrListObject)
{
return this.Context.InsertableByObject(singleEntityObjectOrListObject);
}
public IInsertable<T> Insertable<T>(Dictionary<string, object> columnDictionary) where T : class, new()
{
return this.Context.Insertable<T>(columnDictionary);

5
Src/Asp.NetCore2/SqlSugar/SqlSugarScope.cs

@ -232,7 +232,10 @@ namespace SqlSugar
{
return ScopedContext.Insertable(insertObjs);
}
public InsertMethodInfo InsertableByObject(object singleEntityObjectOrListObject)
{
return ScopedContext.InsertableByObject(singleEntityObjectOrListObject);
}
public void Open()
{
ScopedContext.Open();

Loading…
Cancel
Save