33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
// Copyright (c) .NET Foundation. All rights reserved.
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
using System.Collections.Generic;
|
|
using Microsoft.Framework.Internal;
|
|
|
|
namespace Microsoft.AspNet.Mvc
|
|
{
|
|
/// <summary>
|
|
/// Identifies an action that only supports the HTTP PUT method.
|
|
/// </summary>
|
|
public class HttpPutAttribute : HttpMethodAttribute
|
|
{
|
|
private static readonly IEnumerable<string> _supportedMethods = new string[] { "PUT" };
|
|
|
|
/// <summary>
|
|
/// Creates a new <see cref="HttpPutAttribute"/>.
|
|
/// </summary>
|
|
public HttpPutAttribute()
|
|
: base(_supportedMethods)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates a new <see cref="HttpPutAttribute"/> with the given route template.
|
|
/// </summary>
|
|
/// <param name="template">The route template. May not be null.</param>
|
|
public HttpPutAttribute([NotNull] string template)
|
|
: base(_supportedMethods, template)
|
|
{
|
|
}
|
|
}
|
|
} |