예제 #1
0
 /// <summary>
 /// 解析模板表达式,创建参数化查询对象
 /// </summary>
 /// <param name="templateText">模板文本</param>
 /// <param name="paramaters">模板参数</param>
 /// <returns>参数化查询</returns>
 public static ParameterizedQuery Template(string templateText, params object[] paramaters)
 {
     return(TemplateParser.ParseTemplate(templateText, paramaters));
 }
 /// <summary>
 /// 根据模板表达式创建参数化查询实例
 /// </summary>
 /// <param name="executor">查询执行器</param>
 /// <param name="template">SQL 命令模版</param>
 /// <param name="parameters">模版参数列表</param>
 /// <returns>参数化查询实例</returns>
 public static AsyncDbExecutableQuery <ParameterizedQuery> Template(this IAsyncDbExecutor <ParameterizedQuery> executor, string template, params object[] parameters)
 {
     return(new AsyncDbExecutableQuery <ParameterizedQuery>(executor, TemplateParser.ParseTemplate(template, parameters)));
 }