Browse Source

Update Demo

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
5731c3002f
  1. 12
      Src/Asp.Net/SqlServerTest/Demos/7_Filter.cs

12
Src/Asp.Net/SqlServerTest/Demos/7_Filter.cs

@ -35,6 +35,8 @@ namespace OrmTest.Demo
var sql4 = db.Queryable<Student>().Filter(key,true).ToSql();
//SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE WHERE id>@id
var sql5 = db.Ado.GetInt("select {0}");
//select 1
}
public static SqlSugarClient GetInstance1()
@ -65,6 +67,16 @@ namespace OrmTest.Demo
},
IsJoinQuery = false
});
//Processing prior to execution of SQL
db.Ado.ProcessingEventStartingSQL = (sql, par) =>
{
if (sql.Contains("{0}"))
{
sql = string.Format(sql, "1");
}
return new KeyValuePair<string, SugarParameter[]>(sql,par);
};
return db;
}
}

Loading…
Cancel
Save