本文整理汇总了C#中Burden.SetRootInstance方法的典型用法代码示例。如果您正苦于以下问题:C# Burden.SetRootInstance方法的具体用法?C# Burden.SetRootInstance怎么用?C# Burden.SetRootInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Burden
的用法示例。
在下文中一共展示了Burden.SetRootInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public virtual object Create(CreationContext context, Burden burden)
{
var instance = InternalCreate(context);
burden.SetRootInstance(instance);
onCreation(model, instance);
return instance;
}
示例2: Create
/// <summary>
/// Creates the <see cref="ISessionFactory"/> from the configuration
/// </summary>
/// <param name="context"></param>
/// <param name="burden"></param>
/// <returns></returns>
public override object Create(CreationContext context, Burden burden)
{
//HACK:bugfix SessionFactoryActivator override Create with burden
RaiseCreatingSessionFactory();
var configuration = Model.ExtendedProperties[Constants.SessionFactoryConfiguration]
as Configuration;
var f= configuration.BuildSessionFactory();
burden.SetRootInstance(f);
//onCreation(model, instance);
return f;
}
示例3: Create
/// <summary>
/// Creates the <see cref="ISessionFactory"/> from the configuration
/// </summary>
/// <param name="context"></param>
/// <param name="burden"> </param>
/// <returns></returns>
public override object Create(CreationContext context, Burden burden)
{
RaiseCreatingSessionFactory();
var configuration = Model.ExtendedProperties[Constants.SessionFactoryConfiguration]
as Configuration;
var factory = configuration.BuildSessionFactory();
burden.SetRootInstance(factory);
return factory;
}
开发者ID:hconceicao,项目名称:Castle.Facilities.NHibernateIntegration3,代码行数:18,代码来源:SessionFactoryActivator.cs
示例4: CreateInstance
protected override object CreateInstance(CreationContext context, Burden burden)
{
if (pool == null)
{
lock (ComponentActivator)
{
if (pool == null)
{
pool = CreatePool(initialSize, maxSize);
}
}
}
var instance = pool.Request(context);
burden.SetRootInstance(instance);
return instance;
}
示例5: CreateInstance
protected virtual object CreateInstance(CreationContext context, Burden burden)
{
var instance = componentActivator.Create(context);
burden.SetRootInstance(instance);
return instance;
}