// 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.Core; using Microsoft.AspNetCore.Mvc.Routing; namespace Microsoft.AspNetCore.Mvc { /// /// Specifies the area containing a controller or action. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class AreaAttribute : RouteValueAttribute { /// /// Initializes a new instance. /// /// The area containing the controller or action. public AreaAttribute(string areaName) : base("area", areaName) { if (string.IsNullOrEmpty(areaName)) { throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(areaName)); } } } }