mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 12:09:29 +08:00
Support IsOnlyIgnoreInsert
This commit is contained in:
@@ -64,7 +64,7 @@ namespace OrmTest.Demo
|
|||||||
t12.Wait();
|
t12.Wait();
|
||||||
|
|
||||||
//update one columns
|
//update one columns
|
||||||
var count = db.Updateable<Student>().UpdateColumns(it => it.SchoolId == it.SchoolId+1).Where(it => it.Id == it.Id+1).ExecuteCommand();
|
var count = db.Updateable<Student>().UpdateColumns(it => it.SchoolId == it.SchoolId).Where(it => it.Id == it.Id+1).ExecuteCommand();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace OrmTest.Demo
|
namespace OrmTest.Demo
|
||||||
{
|
{
|
||||||
public class D_QueryableViewn : DemoBase
|
public class QueryableView : DemoBase
|
||||||
{
|
{
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
29
Src/Asp.Net/SqlServerTest/Demos/E_Attribute.cs
Normal file
29
Src/Asp.Net/SqlServerTest/Demos/E_Attribute.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using SqlSugar;
|
||||||
|
namespace OrmTest.Demo
|
||||||
|
{
|
||||||
|
public class AttributeDemo : DemoBase
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = GetInstance();
|
||||||
|
AttributeTest a = new AttributeTest()
|
||||||
|
{
|
||||||
|
Name = "attr"
|
||||||
|
};
|
||||||
|
db.Insertable(a).AS("student").ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AttributeTest
|
||||||
|
{
|
||||||
|
[SugarColumn(ColumnName = "Id")]
|
||||||
|
public int Aid { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
[SugarColumn(IsOnlyIgnoreInsert = true)]
|
||||||
|
public int CreateTime { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -36,20 +36,21 @@ namespace OrmTest
|
|||||||
new SqlSugarPerformance(100).Select();
|
new SqlSugarPerformance(100).Select();
|
||||||
|
|
||||||
/***Demo***/
|
/***Demo***/
|
||||||
OrmTest.Demo.Query.Init();
|
Demo.Query.Init();
|
||||||
OrmTest.Demo.Insert.Init();
|
Demo.Insert.Init();
|
||||||
OrmTest.Demo.Delete.Init();
|
Demo.Delete.Init();
|
||||||
OrmTest.Demo.Update.Init();
|
Demo.Update.Init();
|
||||||
OrmTest.Demo.DbFirst.Init();
|
Demo.DbFirst.Init();
|
||||||
OrmTest.Demo.JoinSql.Init();
|
Demo.JoinSql.Init();
|
||||||
OrmTest.Demo.Filter.Init();
|
Demo.Filter.Init();
|
||||||
OrmTest.Demo.ComplexModel.Init();
|
Demo.ComplexModel.Init();
|
||||||
OrmTest.Demo.CodeFirst.Init();
|
Demo.CodeFirst.Init();
|
||||||
OrmTest.Demo.Aop.Init();
|
Demo.Aop.Init();
|
||||||
OrmTest.Demo.MasterSlave.Init();
|
Demo.MasterSlave.Init();
|
||||||
OrmTest.Demo.SharedConnection.Init();
|
Demo.SharedConnection.Init();
|
||||||
OrmTest.Demo.ExtSqlFun.Init();
|
Demo.ExtSqlFun.Init();
|
||||||
OrmTest.Demo.D_QueryableViewn.Init();
|
Demo.QueryableView.Init();
|
||||||
|
Demo.AttributeDemo.Init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -57,12 +57,13 @@
|
|||||||
<Compile Include="Demos\9_Aop.cs" />
|
<Compile Include="Demos\9_Aop.cs" />
|
||||||
<Compile Include="Demos\B_SharedConnection.cs" />
|
<Compile Include="Demos\B_SharedConnection.cs" />
|
||||||
<Compile Include="Demos\C_ExtSqlFun.cs" />
|
<Compile Include="Demos\C_ExtSqlFun.cs" />
|
||||||
<Compile Include="Demos\DemoBase.cs" />
|
<Compile Include="Demos\Z_DemoBase.cs" />
|
||||||
<Compile Include="Demos\3_Insert.cs" />
|
<Compile Include="Demos\3_Insert.cs" />
|
||||||
<Compile Include="Demos\1_Query.cs" />
|
<Compile Include="Demos\1_Query.cs" />
|
||||||
<Compile Include="Demos\2_Update.cs" />
|
<Compile Include="Demos\2_Update.cs" />
|
||||||
<Compile Include="Demos\A_MasterSlave.cs" />
|
<Compile Include="Demos\A_MasterSlave.cs" />
|
||||||
<Compile Include="Demos\D_QueryableView.cs" />
|
<Compile Include="Demos\D_QueryableView.cs" />
|
||||||
|
<Compile Include="Demos\E_Attribute.cs" />
|
||||||
<Compile Include="Models\DataTestInfo.cs" />
|
<Compile Include="Models\DataTestInfo.cs" />
|
||||||
<Compile Include="Models\DataTestInfo2.cs" />
|
<Compile Include="Models\DataTestInfo2.cs" />
|
||||||
<Compile Include="Models\Enum.cs" />
|
<Compile Include="Models\Enum.cs" />
|
||||||
|
@@ -135,6 +135,7 @@ namespace SqlSugar
|
|||||||
column.DataType = sugarColumn.ColumnDataType;
|
column.DataType = sugarColumn.ColumnDataType;
|
||||||
column.DecimalDigits = sugarColumn.DecimalDigits;
|
column.DecimalDigits = sugarColumn.DecimalDigits;
|
||||||
column.OracleSequenceName = sugarColumn.OracleSequenceName;
|
column.OracleSequenceName = sugarColumn.OracleSequenceName;
|
||||||
|
column.IsOnlyIgnoreInsert = sugarColumn.IsOnlyIgnoreInsert;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -25,5 +25,6 @@ namespace SqlSugar
|
|||||||
public string DataType { get; set; }
|
public string DataType { get; set; }
|
||||||
public int DecimalDigits { get; set; }
|
public int DecimalDigits { get; set; }
|
||||||
public string OracleSequenceName { get; set; }
|
public string OracleSequenceName { get; set; }
|
||||||
|
public bool IsOnlyIgnoreInsert { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -98,6 +98,13 @@ namespace SqlSugar
|
|||||||
get { return _OracleSequenceName; }
|
get { return _OracleSequenceName; }
|
||||||
set { _OracleSequenceName = value; }
|
set { _OracleSequenceName = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _IsOnlyIgnoreInsert;
|
||||||
|
public bool IsOnlyIgnoreInsert
|
||||||
|
{
|
||||||
|
get { return _IsOnlyIgnoreInsert; }
|
||||||
|
set { _IsOnlyIgnoreInsert = value; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user