This commit is contained in:
sunkaixuan
2025-09-11 19:56:17 +08:00
parent a09885114a
commit 683c30c23d
2 changed files with 41 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ namespace OrmTest
}
public static void Init()
{
Unitadsfadfsy23131.Init();
Unitfasdfasysfs.Init();
UnitOneToManyNsdfafa.Init();
Unitasdfays.Init();

View File

@@ -0,0 +1,40 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
internal class Unitadsfadfsy23131
{
public static void Init()
{
var db = NewUnitTest.Db;
SugarParameter [] ps = null;
db.Aop.OnLogExecuting = (sql, p) =>
{
Console.WriteLine(UtilMethods.GetNativeSql(sql, p));
ps = p;
};
db.CodeFirst.InitTables<Unitdafadfa>();
db.Storageable(new Unitdafadfa() { no2="", no1="",xx=""})
.WhereColumns(it => new { it.no1, it.no2 })
.ExecuteCommand();
if (ps.Select(it => it.DbType+"").Distinct().Count() != 3)
{
throw new Exception("unit error");
}
}
public class Unitdafadfa
{
[SqlSugar.SugarColumn(SqlParameterDbType =System.Data.DbType.AnsiStringFixedLength)]
public string no1 { get; set; }
[SqlSugar.SugarColumn(SqlParameterDbType = System.Data.DbType.StringFixedLength)]
public string no2 { get; set; }
public string xx { get; set; }
}
}
}