本文整理汇总了C#中Dialect.IsQuoted方法的典型用法代码示例。如果您正苦于以下问题:C# Dialect.IsQuoted方法的具体用法?C# Dialect.IsQuoted怎么用?C# Dialect.IsQuoted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialect
的用法示例。
在下文中一共展示了Dialect.IsQuoted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToAliasString
/// <summary>
///
/// </summary>
/// <param name="sqlIdentifier"></param>
/// <param name="dialect"></param>
/// <returns></returns>
public string ToAliasString( string sqlIdentifier, Dialect.Dialect dialect )
{
bool isQuoted = dialect.IsQuoted( sqlIdentifier );
string unquoted;
if( isQuoted )
{
unquoted = dialect.UnQuote( sqlIdentifier );
}
else
{
unquoted = sqlIdentifier;
}
// Oracle doesn't like underscores at the start of identifiers (NH-320).
// It should be safe to trim them here, because the aliases are postfixed
// with a unique number anyway, so they won't collide.
unquoted = unquoted.TrimStart( '_' );
if( unquoted.Length > length )
{
unquoted = unquoted.Substring( 0, length );
}
if( suffix != null )
{
unquoted += suffix;
}
if( isQuoted )
{
return dialect.QuoteForAliasName( unquoted );
}
else
{
return unquoted;
}
}