From 9a41c9d487fd4bb266846388a0602ada08cdc474 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 3 Feb 2023 04:48:38 +0800 Subject: [PATCH] Update demo --- .../Net7Test/NET7Test/NET7Test/Program.cs | 19 +++++++++++++++++- .../Net7Test/NET7Test/NET7Test/UserInfo.cs | 20 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/UserInfo.cs diff --git a/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs b/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs index 9ed8cc1c1..a3738ca90 100644 --- a/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs +++ b/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/Program.cs @@ -1,4 +1,5 @@ -using SqlSugar; +using NET7Test; +using SqlSugar; SqliteTest(); MyTest(); @@ -64,8 +65,24 @@ static void ServerTest() var d1 = new UnitDate01231().dateOnly; var d2 = new UnitDate01231().timeOnly; + + ////测试demo2,成功 + string json = @" { + ""user_name"": ""Jack5"", + ""pwd"": ""123456"", + ""create_user_id"": 1, + ""gmt_modified"": ""2023-02-01T04:40:04.700Z"", + ""deleted"": 0 + }"; + + + sqlugar.CodeFirst.InitTables(); + //测试demo3, 5.1.3.47版本不成功, 5.0.9.6版本成功 + Dictionary data3 = System.Text.Json.JsonSerializer.Deserialize>(json); + sqlugar.Insertable(data3).AS("Userinfo021").ExecuteReturnBigIdentity(); } + static void SqliteTest() { var sqlugar = new SqlSugarClient(new ConnectionConfig() diff --git a/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/UserInfo.cs b/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/UserInfo.cs new file mode 100644 index 000000000..bbecdbf97 --- /dev/null +++ b/Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/UserInfo.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NET7Test +{ + public class Userinfo021 + { + [SqlSugar.SugarColumn( IsIdentity =true)] + public int id { get; set; } + public string user_name { get; set; } + public string pwd { get; set; } + public int create_user_id { get; set; } + public DateTime gmt_modified { get; set; } + public bool deleted { get; set; } + } + +}