SqlSugar源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.1 KiB

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>()
.Where(it => it.EmpLicense.EmpInformation.EmpDepartmentJobs.Any())
.ToList();
db.Queryable<Order>()
.Where(b =>
$"{b.Name}^{b.Name}^{b.Name}^{b.Id}^{1} ".Contains("a")).ToList();
var sql = db.Queryable<Order>()
.Where(b =>
$"{b.Name}^{b.Name}^{b.Name}^{b.Id}^{1} ".Contains("a")).ToSqlString();
if (!sql.Contains("(''+ CAST('[Name]' AS NVARCHAR(MAX))+'^'+ CAST('[Name]' AS NVARCHAR(MAX))+'^'+ CAST('[Name]' AS NVARCHAR(MAX))+'^'+ CAST('[Id]' AS NVARCHAR(MAX))+'^'+ CAST(' 1 ' AS NVARCHAR(MAX))+'' like"))
{
throw new Exception("unit error");
}
}
}
}