diff --git a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj index deba7e3e9..213e7351f 100644 --- a/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj +++ b/Src/Asp.Net/SqlServerTest/SqlServerTest.csproj @@ -79,6 +79,7 @@ + diff --git a/Src/Asp.Net/SqlServerTest/_OldTest/BugTest/Bug4.cs b/Src/Asp.Net/SqlServerTest/_OldTest/BugTest/Bug4.cs new file mode 100644 index 000000000..f6cd7b7c3 --- /dev/null +++ b/Src/Asp.Net/SqlServerTest/_OldTest/BugTest/Bug4.cs @@ -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().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; } + } + } + + +}