how can I get reference to current SqlConnection or Sqlconnection in config?
and code
private string GetSqlConnection()
{
IConfigurationSource config = GetConfigSource();
IConfiguration db2 = config.GetConfiguration(typeof(ActiveRecordBase));
string conn = string.Empty;
foreach (IConfiguration child in db2.Children)
{
if (child.Name == "connection.connection_string")
{
conn = child.Value;
}
}
return conn;
}
But I cant understand where I can find "GetConfigSource" implementation? Is this standart Castle helper function or not?
I use these namespaces
using Castle.ActiveRecord;
using NHibernate.Criterion;
using NHibernate;
using Castle.Core.Configuration;
using Castle.ActiveRecord.Framework;