mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
-
This commit is contained in:
@@ -178,6 +178,15 @@ namespace OrmTest.Demo
|
|||||||
var between = db.Queryable<Student>().Where(it => SqlFunc.Between(it.Id, 1, 20)).ToList();
|
var between = db.Queryable<Student>().Where(it => SqlFunc.Between(it.Id, 1, 20)).ToList();
|
||||||
|
|
||||||
var getTodayList = db.Queryable<Student>().Where(it => SqlFunc.DateIsSame(it.CreateTime, DateTime.Now)).ToList();
|
var getTodayList = db.Queryable<Student>().Where(it => SqlFunc.DateIsSame(it.CreateTime, DateTime.Now)).ToList();
|
||||||
|
|
||||||
|
int p = 0;
|
||||||
|
var getSubQuery = db.Queryable<Student>().Select(it =>
|
||||||
|
new Student
|
||||||
|
{
|
||||||
|
Name = it.Name,
|
||||||
|
Id = SqlFunc.Subqueryable<School>().Where(s=>s.Id==1&&s.Id==p).Where(s => s.Id == it.Id).OrderBy(s=>s.Id).Select(s => s.Id)
|
||||||
|
}).ToPageListAsync(1,2);
|
||||||
|
getSubQuery.Wait();
|
||||||
}
|
}
|
||||||
public static void Page()
|
public static void Page()
|
||||||
{
|
{
|
||||||
|
@@ -14,7 +14,7 @@ namespace OrmTest.Demo
|
|||||||
db.Ado.IsEnableLogEvent = true;
|
db.Ado.IsEnableLogEvent = true;
|
||||||
db.Ado.LogEventStarting = (sql, pars) =>
|
db.Ado.LogEventStarting = (sql, pars) =>
|
||||||
{
|
{
|
||||||
Console.WriteLine(sql + "\r\n" + pars);
|
Console.WriteLine(sql + "\r\n" +db.Utilities.SerializeObject(pars.ToDictionary(s=>s.ParameterName,s=>s.Value)));
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
};
|
};
|
||||||
return db;
|
return db;
|
||||||
|
@@ -14,7 +14,7 @@ namespace OrmTest.Demo
|
|||||||
db.Ado.IsEnableLogEvent = true;
|
db.Ado.IsEnableLogEvent = true;
|
||||||
db.Ado.LogEventStarting = (sql, pars) =>
|
db.Ado.LogEventStarting = (sql, pars) =>
|
||||||
{
|
{
|
||||||
Console.WriteLine(sql + "\r\n" + pars);
|
Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(s => s.ParameterName, s => s.Value)));
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
};
|
};
|
||||||
return db;
|
return db;
|
||||||
|
@@ -14,7 +14,7 @@ namespace OrmTest.Demo
|
|||||||
db.Ado.IsEnableLogEvent = true;
|
db.Ado.IsEnableLogEvent = true;
|
||||||
db.Ado.LogEventStarting = (sql, pars) =>
|
db.Ado.LogEventStarting = (sql, pars) =>
|
||||||
{
|
{
|
||||||
Console.WriteLine(sql + "\r\n" + pars);
|
Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(s => s.ParameterName, s => s.Value)));
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
};
|
};
|
||||||
return db;
|
return db;
|
||||||
|
Reference in New Issue
Block a user