/// <summary>
        /// Initializes a new instance of the <see cref="ControllerApiVersionConventionBuilder"/> class.
        /// </summary>
        /// <param name="controllerType">The <see cref="Type">type</see> of controller the convention builder is for.</param>
        public ControllerApiVersionConventionBuilder(Type controllerType)
        {
#if WEBAPI
            var webApiController = typeof(System.Web.Http.Controllers.IHttpController);

            if (!webApiController.IsAssignableFrom(controllerType))
            {
                throw new ArgumentException(SR.RequiredInterfaceNotImplemented.FormatDefault(controllerType, webApiController), nameof(controllerType));
            }
#endif
            ControllerType = controllerType;
            ActionBuilders = new ActionApiVersionConventionBuilderCollection(this);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControllerApiVersionConventionBuilder{T}"/> class.
 /// </summary>
 public ControllerApiVersionConventionBuilder()
 {
     ActionBuilders = new ActionApiVersionConventionBuilderCollection <T>(this);
 }