Example #1
0
 public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, HeliosConfig config)
 {
     builder.RegisterType<PerRequestCacheManager>()
         .As<ICacheManager>()
         .Named<ICacheManager>("helios_cache_per_request")
         .InstancePerLifetimeScope();
 }
Example #2
0
 public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, HeliosConfig config)
 {
     //static cache manager
     builder.RegisterType<MemoryCacheManager>()
         .As<ICacheManager>()
         .Named<ICacheManager>("helios_cache_static")
         .SingleInstance();
 }
Example #3
0
        public void Register(ContainerBuilder builder, ITypeFinder typeFinder, HeliosConfig config)
        {
            Logger.Debug("注册数据持久化仓库 IRepository<>");

            builder.Register<IDbContext>(c => new HeliosObjectContext("Database=helios_entity_extensions;Data Source=localhost;User Id=meiyuner;Pwd=Js9zMr36HxJxUU7C;pooling=false;CharSet=utf8mb4;port=3306;Persist Security Info=True;")).InstancePerLifetimeScope();

            builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();
        }
Example #4
0
        public static IEngine Initialize(bool forceRecreate)
        {
            if (Singleton<IEngine>.Instance == null || forceRecreate)
            {
                Singleton<IEngine>.Instance = new Engine();

                var config = new HeliosConfig();
                Singleton<IEngine>.Instance.Initialize(config);
            }
            return Singleton<IEngine>.Instance;
        }
Example #5
0
        public object Create(object parent, object configContext, XmlNode section)
        {
            var config = new HeliosConfig();

            return(config);
        }
Example #6
0
        public object Create(object parent, object configContext, XmlNode section)
        {
            var config = new HeliosConfig();

            return config;
        }