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.

37 lines
930 B

3 years ago
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public class UCustom013
{
public static void Init()
{
var db = new SqlSugarScope(new SqlSugar.ConnectionConfig()
{
ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer,
IsAutoCloseConnection = true
});
db.CodeFirst.InitTables<UnitBoola1>();
3 years ago
db.Insertable(new UnitBoola1() { a = true }).ExecuteCommand();
3 years ago
db.Queryable<Order>()
.Select(x => new
{
3 years ago
x1 =(bool?) SqlFunc.Subqueryable<UnitBoola1>().Select(it => it.a)
3 years ago
}).ToList();
}
public class UnitBoola1
{
public bool a { get; set; }
}
}
}