WindsorStaticCommandServiceLoader.cs

23 lines | 614 B Blame History Raw Download
namespace Web.Infrastructure
{
    using Castle.Windsor;
    using DotVVM.Framework.Hosting;
    using DotVVM.Framework.Runtime;
    using System;

    public class WindsorStaticCommandServiceLoader : DefaultStaticCommandServiceLoader
    {
        private readonly WindsorContainer _container;

        public WindsorStaticCommandServiceLoader(WindsorContainer container)
        {
            _container = container;
        }

        public override object GetStaticCommandService(Type serviceType, IDotvvmRequestContext context)
        {
            return _container.Resolve(serviceType);
        }
    }
}