mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update demo
This commit is contained in:
parent
fff4605a24
commit
9a41c9d487
@ -1,4 +1,5 @@
|
|||||||
using SqlSugar;
|
using NET7Test;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
SqliteTest();
|
SqliteTest();
|
||||||
MyTest();
|
MyTest();
|
||||||
@ -64,8 +65,24 @@ static void ServerTest()
|
|||||||
|
|
||||||
var d1 = new UnitDate01231().dateOnly;
|
var d1 = new UnitDate01231().dateOnly;
|
||||||
var d2 = new UnitDate01231().timeOnly;
|
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<Userinfo021>();
|
||||||
|
//测试demo3, 5.1.3.47版本不成功, 5.0.9.6版本成功
|
||||||
|
Dictionary<string, object> data3 = System.Text.Json.JsonSerializer.Deserialize<Dictionary<string, object>>(json);
|
||||||
|
sqlugar.Insertable(data3).AS("Userinfo021").ExecuteReturnBigIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void SqliteTest()
|
static void SqliteTest()
|
||||||
{
|
{
|
||||||
var sqlugar = new SqlSugarClient(new ConnectionConfig()
|
var sqlugar = new SqlSugarClient(new ConnectionConfig()
|
||||||
|
20
Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/UserInfo.cs
Normal file
20
Src/Asp.NetCore2/Net7Test/NET7Test/NET7Test/UserInfo.cs
Normal file
@ -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; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user