コード例 #1
0
        /// <summary>
        /// Handles the creation of domain service objects.
        /// </summary>
        public DomainService CreateDomainService(Type domainServiceType, DomainServiceContext context)
        {
            var domainService = (DomainService)IoC.GetByType(domainServiceType);

            if (domainService != null)
            {
                domainService.Initialize(context);
            }

            return(domainService);
        }
コード例 #2
0
        protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
        {
            if (controllerType == null)
            {
                return(base.GetControllerInstance(requestContext, controllerType));
            }

            var controller = (IController)IoC.GetByType(controllerType);

            if (controller == null)
            {
                return(base.GetControllerInstance(requestContext, controllerType));
            }

            return(controller);
        }