From ec40ad477d44b6129803d2c9fdf42fd4d0e3f880 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 6 Dec 2022 09:51:55 +0800 Subject: [PATCH] Add demo --- Src/Asp.Net/PgSqlTest/Demo/DemoE_CodeFirst.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Src/Asp.Net/PgSqlTest/Demo/DemoE_CodeFirst.cs b/Src/Asp.Net/PgSqlTest/Demo/DemoE_CodeFirst.cs index 2f6730316..36476de5b 100644 --- a/Src/Asp.Net/PgSqlTest/Demo/DemoE_CodeFirst.cs +++ b/Src/Asp.Net/PgSqlTest/Demo/DemoE_CodeFirst.cs @@ -45,9 +45,21 @@ namespace OrmTest }).ExecuteCommand(); var list5=db.Queryable().ToList(); + db.CodeFirst.InitTables(); + db.Updateable() + .SetColumns(it => it.longs == new long[] { 1, 2 }) + .Where(it=>it.id==1) + .ExecuteCommand(); Console.WriteLine("#### CodeFirst end ####"); } } + public class CodeFirstArraryBigInt + { + [SugarColumn(IsPrimaryKey =true)] + public int id { get; set; } + [SugarColumn(IsArray =true,ColumnDataType ="int8 []")] + public long[] longs { get; set; } + } public class CodeFirstArray { [SugarColumn(IsArray =true,ColumnDataType = "real[]")]