/// <summary>
        /// Creates a mutable list of the default OData routing conventions with attribute routing enabled.
        /// </summary>
        /// <param name="routeName">The name of the route.</param>
        /// <param name="serviceProvider">The service provider.</param>
        /// <returns>A mutable list of the default OData routing conventions.</returns>
        public static IList <IODataRoutingConvention> CreateDefaultWithAttributeRouting(
            string routeName,
            IServiceProvider serviceProvider)
        {
            if (routeName == null)
            {
                throw Error.ArgumentNull("routeName");
            }

            IList <IODataRoutingConvention> routingConventions = CreateDefault();
            AttributeRoutingConvention      routingConvention  = new AttributeRoutingConvention(routeName, serviceProvider);

            routingConventions.Insert(0, routingConvention);
            return(routingConventions);
        }
예제 #2
0
        /// <summary>
        /// Creates a mutable list of the default OData routing conventions with attribute routing enabled.
        /// </summary>
        /// <param name="routeName">The name of the route.</param>
        /// <param name="configuration">The server configuration.</param>
        /// <returns>A mutable list of the default OData routing conventions.</returns>
        public static IList <IODataRoutingConvention> CreateDefaultWithAttributeRouting(
            string routeName,
            HttpConfiguration configuration)
        {
            if (configuration == null)
            {
                throw Error.ArgumentNull("configuration");
            }

            if (routeName == null)
            {
                throw Error.ArgumentNull("routeName");
            }

            IList <IODataRoutingConvention> routingConventions = CreateDefault();
            AttributeRoutingConvention      routingConvention  = new AttributeRoutingConvention(routeName, configuration);

            routingConventions.Insert(0, routingConvention);
            return(routingConventions);
        }