示例#1
0
        /// <summary>
        /// Reorder the list of view metadata.
        /// </summary>
        /// <param name="org">The Organization code for the service owner</param>
        /// <param name="service">The service code for the current service</param>
        /// <param name="edition">The edition code for the current service</param>
        /// <param name="viewOrder">View order as comma-seperated list</param>
        /// <returns>The <see cref="IActionResult"/>.</returns>
        public IActionResult Reorder(string org, string service, string edition, string viewOrder)
        {
            if (string.IsNullOrWhiteSpace(viewOrder) || !Regex.IsMatch(viewOrder, @"(\w,?)+"))
            {
                return(StatusCode((int)HttpStatusCode.NotAcceptable, "viewOrder må være kommaseparert liste av tall."));
            }

            var viewOrderArray = ToIntArray(viewOrder).ToArray();

            _viewRepository.RearrangeViews(org, service, edition, viewOrderArray);

            return(Ok());
        }