/// <summary>
        /// Creates a new <see cref="RouteModuleAttribute"/> with the given route template
        /// and module reference.
        /// </summary>
        /// <param name="module">The route module</param>
        /// <param name="template">The route template. May not be null.</param>
        public RouteModuleAttribute(string module, string template)
        {
            if (template == null)
            {
                throw new ArgumentNullException(nameof(template));
            }

            if (module == null)
            {
                throw new ArgumentException(nameof(module));
            }

            Module = module;

            if (ModulesRoutes.HasMapping(Module))
            {
                Template = ModulesRoutes.GetMapping(Module) + "/" + template;
            }
            else
            {
                Template = template;
            }
        }
 /// <summary>
 /// Maps module routes.
 /// <see cref="RouteModuleAttribute"/>.
 /// </summary>
 /// <returns>The module route.</returns>
 /// <param name="routes">Routes.</param>
 /// <param name="module">The Module Name</param>
 /// <param name="template">The route template</param>
 public static IRouteBuilder MapModuleRoute(this IRouteBuilder routes, string module, string template)
 {
     ModulesRoutes.AddMapping(module, template);
     return(routes);
 }