aspnetcore/src/Microsoft.AspNetCore.Mvc.Core/AreaAttribute.cs

22 lines
712 B
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;
using Microsoft.AspNetCore.Mvc.Routing;
namespace Microsoft.AspNetCore.Mvc
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class AreaAttribute : RouteValueAttribute
{
public AreaAttribute(string areaName)
: base("area", areaName)
{
if (string.IsNullOrEmpty(areaName))
{
throw new ArgumentException("Area name must not be empty", nameof(areaName));
}
}
}
}