///<summary>
/// This method allows direct registration of Configuration
///</summary>
public virtual void RegisterConfiguration(Configuration cfg, string name)
{
var sf = cfg.BuildSessionFactory();
var sfholder = new SfHolder(cfg, sf);
foreach (var classMetadata in sf.GetAllClassMetadata())
{
var entitytype = classMetadata.Value.GetMappedClass(EntityMode.Poco);
if (Type2SessFactory.ContainsKey(entitytype))
{
throw new ActiveRecordException("Type has already been registered -> " + entitytype.FullName);
}
Type2SessFactory.Add(entitytype, sfholder);
}
AR.RaiseSessionFactoryCreated(sf, cfg, name);
}