本文整理汇总了C#中ISqlBuilder.GenerateSql方法的典型用法代码示例。如果您正苦于以下问题:C# ISqlBuilder.GenerateSql方法的具体用法?C# ISqlBuilder.GenerateSql怎么用?C# ISqlBuilder.GenerateSql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISqlBuilder
的用法示例。
在下文中一共展示了ISqlBuilder.GenerateSql方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateSql
/// <summary>
/// Generate the SQL string using <paramref name="sqlBuilder"/> with <paramref name="info"/>
/// </summary>
/// <param name="info">
/// The current dataretrieval state.
/// </param>
/// <param name="sqlBuilder">
/// The sql builder.
/// </param>
private void GenerateSql(DataRetrievalInfo info, ISqlBuilder sqlBuilder)
{
// Generate sql query
Logger.Info(Resources.InfoStartGeneratingSQLDDB);
sqlBuilder.GenerateSql(info);
Logger.Info(Resources.InfoEndGeneratingSQLDDB);
}
示例2: Execute
/// <summary>
/// Execute the specified <paramref name="sqlBuilder"/>, if not null and <paramref name="codeListRetrievalEngine"/>
/// </summary>
/// <param name="info">
/// The current codelist retrieval information
/// </param>
/// <param name="codeListRetrievalEngine">
/// The code list retrieval engine.
/// </param>
/// <param name="sqlBuilder">
/// The sql builder.
/// </param>
/// <returns>
/// The partial codelist
/// </returns>
private static ICodelistMutableObject Execute(
StructureRetrievalInfo info, ICodeListRetrievalEngine codeListRetrievalEngine, ISqlBuilder sqlBuilder)
{
if (sqlBuilder != null)
{
info.Logger.InfoFormat(
CultureInfo.InvariantCulture,
"|-- Generating SQL for dissemination database... using sql builder :{0}",
sqlBuilder);
info.SqlQuery = sqlBuilder.GenerateSql(info);
info.Logger.Info("|-- SQL for dissemination database generated:\n" + info.SqlQuery);
}
info.Logger.Info("|-- Retrieving codes... using codelist retrieval engine " + codeListRetrievalEngine);
ICodelistMutableObject codeListBean = codeListRetrievalEngine.GetCodeList(info);
if (codeListBean != null)
{
info.Logger.Info("|-- Codes retrieved successfully, found : " + codeListBean.Items.Count + " codes");
}
else
{
info.Logger.Warn(
"|-- Warning: Codes not retrieved. The engine " + codeListRetrievalEngine + " returned no codelist.");
}
return codeListBean;
}