本文整理匯總了C#中NHibernate.Cfg.Configuration.GetDerivedProperties方法的典型用法代碼示例。如果您正苦於以下問題:C# Configuration.GetDerivedProperties方法的具體用法?C# Configuration.GetDerivedProperties怎麽用?C# Configuration.GetDerivedProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NHibernate.Cfg.Configuration
的用法示例。
在下文中一共展示了Configuration.GetDerivedProperties方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: QuoteTableAndColumns
public static void QuoteTableAndColumns(Configuration configuration)
{
Iesi.Collections.Generic.ISet<string> reservedDb = GetReservedWords(configuration.GetDerivedProperties());
foreach (var cm in configuration.ClassMappings)
{
QuoteTable(cm.Table, reservedDb);
}
foreach (var cm in configuration.CollectionMappings)
{
QuoteTable(cm.Table, reservedDb);
}
}
示例2: ExecuteScriptFile
private void ExecuteScriptFile(Configuration configuration, string scripFileName)
{
var file = new FileInfo(scripFileName);
string script = file.OpenText().ReadToEnd().Replace("GO", "");
var connectionProvider = ConnectionProviderFactory.NewConnectionProvider(configuration.GetDerivedProperties());
using (var conn = connectionProvider.GetConnection())
{
if (conn.State == ConnectionState.Closed)
{
conn.Open();
}
using (var command = conn.CreateCommand())
{
command.CommandText = script;
command.ExecuteNonQuery();
}
}
}