Update exp to sql

This commit is contained in:
sunkaixuan
2022-03-16 21:38:14 +08:00
parent bac712c597
commit 66837ac18a
4 changed files with 55 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
UCustom010.Init();
UCustom08.Init();
UCustom07.Init();
UCustom01.Init();

View File

@@ -0,0 +1,33 @@
using OrmTest.UnitTest.Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public class UCustom010
{
public static void Init()
{
var db = NewUnitTest.Db;
var list = db.Queryable<Unitasfa1sadfa>()
.Select(x => new { x = Convert.ToBoolean(x.ItemId),
x1 = SqlFunc.ToBool(x.ItemId)
})
.ToList();
}
public class Unitasfa1sadfa
{
[SugarColumn(IsPrimaryKey = true)]
public Guid Id { get; set; }
[SugarColumn(IsNullable = true)]
public bool ItemId { get; set; }
}
}
}