SqlSugar/Src/Asp.NetCore2/SqlSeverTest/UnitTest/UnitOneToOneNAny.cs

28 lines
828 B
C#
Raw Normal View History

2023-07-10 17:11:51 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OrmTest
{
internal class UnitOneToOneNAny
{
public static void Init()
{
var db = NewUnitTest.Db;
db.CodeFirst.InitTables<EmpLicenseLogOff, EmpInformation, EmpDepartmentJob,EmpLicense>();
db.Queryable<EmpLicenseLogOff>()
2023-07-10 20:02:49 +08:00
.Where(it => it.EmpLicense.EmpInformation.EmpDepartmentJobs.Any())
2023-07-11 12:48:48 +08:00
.ToList();
var sql = db.Queryable<Order>()
.Where(b =>
$"{b.Name}^{b.Name}^{b.Name}^{b.Id}^{1} ".Contains("a")).ToSqlString();
if (!sql.Contains("'[Name]^[Name]^[Name]^[Id]^ 1 ' like"))
{
throw new Exception("unit error");
}
2023-07-10 17:11:51 +08:00
}
}
}