mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update Demo
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
<Compile Include="Models\ViewOrder.cs" />
|
||||
<Compile Include="UnitTest\UQueue.cs" />
|
||||
<Compile Include="_OldTest\BugTest\Bug2.cs" />
|
||||
<Compile Include="_OldTest\BugTest\Bug4.cs" />
|
||||
<Compile Include="_OldTest\BugTest\BugModels\AccountsModel.cs" />
|
||||
<Compile Include="_OldTest\BugTest\BugModels\ClientsModel.cs" />
|
||||
<Compile Include="_OldTest\BugTest\BugModels\ExposureModel.cs" />
|
||||
|
46
Src/Asp.Net/SqlServerTest/_OldTest/BugTest/Bug4.cs
Normal file
46
Src/Asp.Net/SqlServerTest/_OldTest/BugTest/Bug4.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.Test
|
||||
{
|
||||
public class BugTest4
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
SqlSugarClient Db = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
ConnectionString = Config.ConnectionString,
|
||||
DbType = DbType.SqlServer,
|
||||
IsAutoCloseConnection = true,
|
||||
//MoreSettings = new ConnMoreSettings()
|
||||
//{
|
||||
// PgSqlIsAutoToLower = true //我们这里需要设置为false
|
||||
//},
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
});
|
||||
//调式代码 用来打印SQL
|
||||
Db.Aop.OnLogExecuting = (sql, pars) =>
|
||||
{
|
||||
Console.WriteLine(sql);
|
||||
};
|
||||
|
||||
Db.CodeFirst.InitTables(typeof(Testmmm));
|
||||
Db.Insertable(new Testmmm() { b = "a" }).InsertColumns(it => new { it.b}).ExecuteCommand();
|
||||
var list = Db.Queryable<Testmmm>().ToList();
|
||||
}
|
||||
public class Testmmm {
|
||||
[SugarColumn(IsIdentity =true,IsPrimaryKey =true)]
|
||||
public int id { get; set; }
|
||||
[SugarColumn(ColumnDataType ="nvarchar",Length =8, DefaultValue ="222", ColumnDescription ="aa")]
|
||||
public string a { get; set; }
|
||||
public string b { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user