protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); MvcDependencyResolver.ForRepositoriesUseSharpRepository("repository.json", "sharpRepository", null, Lifecycles.Get <SingletonLifecycle>()); }
public void SetLifecycleTo <T>() where T : ILifecycle, new() { _lifecycle = Lifecycles.Get <T>(); }
/// <summary> /// Use InstanceScope for the constants now /// </summary> /// <typeparam name="T"></typeparam> public void SetScopeTo <T>() where T : ILifecycle, new() { _lifecycle = new Lazy <ILifecycle>(() => Lifecycles.Get <T>()); }
public void getting_transient_gets_the_flyweight() { Lifecycles.Get <TransientLifecycle>().ShouldBeTheSameAs(Lifecycles.Transient); }
public void getting_unique_gets_the_flyweight() { Lifecycles.Get <UniquePerRequestLifecycle>().ShouldBeTheSameAs(Lifecycles.Unique); }
public void getting_singleton_gets_the_flyweight() { Lifecycles.Get <SingletonLifecycle>().ShouldBeTheSameAs(Lifecycles.Singleton); }