mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
-
This commit is contained in:
parent
bf34aa39c0
commit
074b367248
@ -178,6 +178,15 @@ namespace OrmTest.Demo
|
||||
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();
|
||||
|
||||
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()
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace OrmTest.Demo
|
||||
db.Ado.IsEnableLogEvent = true;
|
||||
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();
|
||||
};
|
||||
return db;
|
||||
|
@ -14,7 +14,7 @@ namespace OrmTest.Demo
|
||||
db.Ado.IsEnableLogEvent = true;
|
||||
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();
|
||||
};
|
||||
return db;
|
||||
|
@ -14,7 +14,7 @@ namespace OrmTest.Demo
|
||||
db.Ado.IsEnableLogEvent = true;
|
||||
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();
|
||||
};
|
||||
return db;
|
||||
|
Loading…
Reference in New Issue
Block a user