using Cowain.Bake.Common.Interface; using Prism.Ioc; using Prism.Modularity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Cowain.Bake.BLL { public class BLLModule : IModule { public void OnInitialized(IContainerProvider containerProvider) //IUnityContainer { // 将容器实例注册为单例 MyAppContainer.Current = containerProvider; //containerProvider.Resolve(); // } public void RegisterTypes(IContainerRegistry containerRegistry) { containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); //containerRegistry.RegisterSingleton(); //IMemoryDataProvider containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); } } // 定义一个静态类,用于保存全局的IUnityContainer实例 public static class MyAppContainer { public static IContainerProvider Current { get; set; } } }