diff --git a/src/Microsoft.AspNetCore.Mvc.Core/ApiControllerAttribute.cs b/src/Microsoft.AspNetCore.Mvc.Core/ApiControllerAttribute.cs new file mode 100644 index 0000000000..98b6f5c084 --- /dev/null +++ b/src/Microsoft.AspNetCore.Mvc.Core/ApiControllerAttribute.cs @@ -0,0 +1,18 @@ +// 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.Internal; + +namespace Microsoft.AspNetCore.Mvc +{ + /// + /// Indicates that a type and all derived types are used to serve HTTP API responses. The presense of + /// this attribute can be used to target conventions, filters and other behaviors based on the purpose + /// of the controller. + /// + [AttributeUsage(AttributeTargets.Class)] + public class ApiControllerAttribute : ControllerAttribute , IApiBehaviorMetadata + { + } +} diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Internal/IApiBehaviorMetadata.cs b/src/Microsoft.AspNetCore.Mvc.Core/Internal/IApiBehaviorMetadata.cs new file mode 100644 index 0000000000..b73c1ba56e --- /dev/null +++ b/src/Microsoft.AspNetCore.Mvc.Core/Internal/IApiBehaviorMetadata.cs @@ -0,0 +1,15 @@ +// 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 Microsoft.AspNetCore.Mvc.Filters; + +namespace Microsoft.AspNetCore.Mvc.Internal +{ + /// + /// An interface for . See + /// for details. + /// + public interface IApiBehaviorMetadata : IFilterMetadata + { + } +}