- 修复 1.7.1 IsNullable 遗留问题;

This commit is contained in:
28810
2020-08-10 12:27:39 +08:00
parent 549d36974d
commit d602dfbaaa
3 changed files with 29 additions and 3 deletions

View File

@ -158,20 +158,30 @@ namespace FreeSql.Tests
class testInsertNullable
{
[Column(IsIdentity = true)]
[Column(IsNullable = false, IsIdentity = true)]
public long Id { get; set; }
[Column(IsNullable = false)]
public string str1 { get; set; }
[Column(IsNullable = false)]
public int? int1 { get; set; }
[Column(IsNullable = true)]
public int int2 { get; set; }
}
[Fact]
public void Test03()
{
g.sqlite.Insert(new testInsertNullable()).NoneParameter().ExecuteAffrows();
var ddlsql = g.sqlite.CodeFirst.GetComparisonDDLStatements(typeof(testInsertNullable), "tb123123");
Assert.Equal(@"CREATE TABLE IF NOT EXISTS ""main"".""tb123123"" (
""Id"" INTEGER PRIMARY KEY AUTOINCREMENT,
""str1"" NVARCHAR(255) NOT NULL,
""int1"" INTEGER NOT NULL,
""int2"" INTEGER
)
;
", ddlsql);
var sqlxx = g.pgsql.InsertOrUpdate<userinfo>().SetSource(new userinfo { userid = 10 }).UpdateColumns(a => new { a.birthday, a.CardNo }).ToSql();