// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using Microsoft.AspNet.Mvc.Routing; namespace Microsoft.AspNet.Mvc { /// /// Identifies an action that only supports the HTTP PUT method. /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class HttpPutAttribute : Attribute, IActionHttpMethodProvider, IRouteTemplateProvider { private static readonly IEnumerable _supportedMethods = new string[] { "PUT" }; /// /// Creates a new . /// public HttpPutAttribute() { } /// /// Creates a new with the given route template. /// /// The route template. May not be null. public HttpPutAttribute([NotNull] string template) { Template = template; } /// public IEnumerable HttpMethods { get { return _supportedMethods; } } /// public string Template { get; private set; } } }