本文整理汇总了C#中IUnityContainer.BuildUp方法的典型用法代码示例。如果您正苦于以下问题:C# IUnityContainer.BuildUp方法的具体用法?C# IUnityContainer.BuildUp怎么用?C# IUnityContainer.BuildUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUnityContainer
的用法示例。
在下文中一共展示了IUnityContainer.BuildUp方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterInstances
protected override void RegisterInstances(IUnityContainer container)
{
var admin = new AdminUserRepository();
container.BuildUp(admin.GetType(), admin);
container.RegisterInstance<IAdminUserRepository>(admin);
var tmpl = new CuratedGalleryRepository();
container.BuildUp(tmpl.GetType(), tmpl);
container.RegisterInstance<ICuratedGalleryRepository>(tmpl);
}
示例2: RegisterInstances
protected virtual void RegisterInstances(IUnityContainer container)
{
//some necessary type or instance registration
//....
//take into account that if the repository is depended on any other type or repository then they must be registered before
//in section above
var user = new UserRepository();
container.BuildUp(user.GetType(), user);
container.RegisterInstance<IUserRepository>(user);
var search = new SearchRepository();
container.BuildUp(search.GetType(), search);
container.RegisterInstance<ISearchRepository>(search);
}
示例3: BuildUpPackageViewModel
protected virtual void BuildUpPackageViewModel(IUnityContainer container)
{
container.BuildUp(PackageViewModel);
}
示例4: TestInitialize
public void TestInitialize()
{
_container = new GwnClassBase().GetContainer();
_container.BuildUp(GetType(), this);
}
示例5: BuildUp
/// <summary>
/// Build up this class
/// </summary>
/// <param name="container"></param>
public void BuildUp(IUnityContainer container)
{
container.BuildUp(GetType(), this);
}
示例6: BuildUpConsoleViewModel
protected virtual void BuildUpConsoleViewModel(IUnityContainer container)
{
container.BuildUp(ViewModel);
}