コード例 #1
0
        public void CommandTest()
        {
            BaseTest();
            string routeKey     = CommandRoute.GetKeyFromPath("/testcontroller/cmd1");
            var    commandRoute = _commandRouteDictionary[routeKey];

            Assert.NotNull(commandRoute);
        }
コード例 #2
0
ファイル: ServiceRouteProvider.cs プロジェクト: kzwr/Chromely
        public static CommandRoute GetCommandRoute(IChromelyContainer container, string commandPath)
        {
            var key = CommandRoute.GetKeyFromPath(commandPath);
            object commandObj = container.GetInstance(typeof(CommandRoute), key);
            if ((commandObj == null) || !(commandObj is CommandRoute))
            {
                throw new Exception($"No route found for command with key:{key}.");
            }

            return (CommandRoute)commandObj;
        }
コード例 #3
0
        public static CommandRoute GetCommandRoute(IChromelyContainer container, string commandPath)
        {
            var key     = CommandRoute.GetKeyFromPath(commandPath);
            var command = container.GetInstance(typeof(CommandRoute), key) as CommandRoute;

            if (command == null)
            {
                throw new Exception($"No route found for command with key:{key}.");
            }

            return(command);
        }