forked from haoduotnt/aspnetwebstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoutePrefixAttribute.cs
More file actions
30 lines (27 loc) · 1018 Bytes
/
RoutePrefixAttribute.cs
File metadata and controls
30 lines (27 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
namespace System.Web.Http
{
/// <summary>
/// Annotates a controller with a route prefix that applies to all actions within the controller.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class RoutePrefixAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="RoutePrefixAttribute" /> class.
/// </summary>
/// <param name="prefix">The route prefix for the controller.</param>
public RoutePrefixAttribute(string prefix)
{
if (prefix == null)
{
throw Error.ArgumentNull("prefix");
}
Prefix = prefix;
}
/// <summary>
/// Gets the route prefix.
/// </summary>
public string Prefix { get; private set; }
}
}