private static DynamicApiRepositoryAction CreateAction(IRepositoryManager repositoryManager, string repositoryName, string actionName, MethodInfo method, MethodInfo interfaceMethod)
        {
            var action = new DynamicApiRepositoryAction
            {
                RepositoryManager = repositoryManager,
                RepositoryName    = repositoryName,
                Parameters        = DynamicApiActionParameter.GetParameters(interfaceMethod),
                Path = new DynamicApiActionPath(repositoryName, actionName),
            };

            action.SetMethod(method);
            return(action);
        }
        /// <summary>
        /// Register a controller and it's actions.
        /// </summary>
        public void RegisterController(Type type)
        {
            var actions = type.GetMethods().Where(e => Attribute.IsDefined((MemberInfo)e, typeof(ApiActionAttribute)));

            foreach (var action in actions)
            {
                var attribute = action.GetCustomAttribute <ApiActionAttribute>();
                var path      = attribute.Path.Split('/');

                var controllerAction = new DynamicApiControllersAction(_container)
                {
                    Path           = new DynamicApiActionPath(path[0], path[1]),
                    ControllerType = type,
                    Parameters     = DynamicApiActionParameter.GetParameters(action),
                };
                controllerAction.SetMethod(action);
                _actions.Add(controllerAction);
            }
        }