Example #1
0
        public override void InstallFeatures(FromDescriptor from)
        {
            var mvcControllers = from
                                 .BasedOn(typeof(IController))
                                 .If(controller => controller.Is <IContextual>())
                                 .LifestyleCustom <ContextualLifestyleManager>()
                                 .WithServiceSelf();

            if (_configureMvc != null)
            {
                mvcControllers.Configure(_configureMvc);
            }

            var apiControllers = from
                                 .BasedOn(typeof(IHttpController))
                                 .If(controller => controller.Is <IContextual>())
                                 .LifestyleCustom <ContextualLifestyleManager>()
                                 .WithServiceSelf();

            if (_configureApi != null)
            {
                apiControllers.Configure(_configureApi);
            }
        }
Example #2
0
 private BasedOnDescriptor Locate(FromDescriptor fromDescriptor)
 {
     return(_serviceDescriptor(fromDescriptor.BasedOn <T>().WithService));
 }