From 008892a1da2d91be56f4a36b8f30fb53f4f72a7b Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 22 Jun 2024 18:34:41 +0800 Subject: [PATCH] Add user test demo --- .../PgSqlTest/UserTestCases/UCodeFirst.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Src/Asp.NetCore2/PgSqlTest/UserTestCases/UCodeFirst.cs b/Src/Asp.NetCore2/PgSqlTest/UserTestCases/UCodeFirst.cs index ba0bc7819..7fcbcfc0a 100644 --- a/Src/Asp.NetCore2/PgSqlTest/UserTestCases/UCodeFirst.cs +++ b/Src/Asp.NetCore2/PgSqlTest/UserTestCases/UCodeFirst.cs @@ -34,6 +34,27 @@ namespace OrmTest X1.Id == Y1.Id) .Where(X1 => X1.Id == 1) .Select().ToList(); + db = NewUnitTest.Db; + db.CodeFirst.InitTables(); + db.DbMaintenance.TruncateTable(); + db.Insertable(new Unitadfafay1() { a = "a" }).ExecuteCommand(); + db.CodeFirst.InitTables(); + var bvalue=db.Queryable().First().b; + if (bvalue != "b") + { + throw new Exception("unit error"); + } + } + + public class Unitadfafay1 + { + public string a { get; set; } + } + public class UNITADFAFAY1 + { + public string a { get; set; } + [SugarColumn(DefaultValue ="b")] + public string b { get; set; } } public class VUpperOrder