mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add demo
This commit is contained in:
parent
f9ef41094e
commit
ae272047d2
36
Src/Asp.NetCore2/ClickHouseTest/Test/Unitasdfayasdfa.cs
Normal file
36
Src/Asp.NetCore2/ClickHouseTest/Test/Unitasdfayasdfa.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using OrmTest;
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ClickHouseTest
|
||||||
|
{
|
||||||
|
public class Unitasdfayasdfa
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = new SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||||
|
{
|
||||||
|
ConnectionString = Config.ConnectionString,
|
||||||
|
DbType = SqlSugar.DbType.ClickHouse,
|
||||||
|
IsAutoCloseConnection = true
|
||||||
|
});
|
||||||
|
db.Aop.OnLogExecuting = (sql, pars) => {
|
||||||
|
var log = $"【{DateTime.Now}——执行SQL】\r\n{UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, sql, pars)}\r\n";
|
||||||
|
Console.WriteLine(log);
|
||||||
|
};
|
||||||
|
|
||||||
|
db.CodeFirst.InitTables<UnitUint>();
|
||||||
|
db.Insertable(new UnitUint() { id = 11 }).ExecuteCommand();
|
||||||
|
var lit=db.Queryable<UnitUint>().ToList();
|
||||||
|
}
|
||||||
|
public class UnitUint
|
||||||
|
{
|
||||||
|
[SqlSugar.SugarColumn(ColumnDataType = "uint32")]
|
||||||
|
public uint id { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user