Files
sunkaixuan 893430b2ae Update demo
2025-12-05 12:15:01 +08:00

40 lines
1002 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
internal class UnitBool
{
public int num { get; set; }
public static void Init()
{
var db = NewUnitTest.Db;
db.CodeFirst.InitTables<UnitADFA>();
var p = new UnitBool();
db.Updateable<UnitADFA>()
.SetColumns(it => new UnitADFA()
{
a = p.num > 1
})
.Where(it=>it.id==1)
.ExecuteCommand();
db.Updateable<UnitADFA>()
.SetColumns(it => new UnitADFA()
{
a = it.id > 1
})
.Where(it => it.id == 1)
.ExecuteCommand();
}
public class UnitADFA
{
public int id { get; set; }
public bool a { get; set; }
}
}
}