dotnet-cqrs/PoweredSoft.CQRS.AspNetCore/Mvc/CommandControllerAuthorizationAttribute.cs
2021-02-04 21:09:29 -05:00

22 lines
610 B
C#

using System;
using Microsoft.AspNetCore.Mvc;
namespace PoweredSoft.CQRS.AspNetCore.Mvc
{
[AttributeUsage(AttributeTargets.Method)]
public class CommandControllerAuthorizationAttribute : TypeFilterAttribute
{
public CommandControllerAuthorizationAttribute() : base(typeof(CommandControllerAsyncAuthorizationFilter))
{
}
public CommandControllerAuthorizationAttribute(Type commandType) : base(typeof(CommandControllerAsyncAuthorizationFilter))
{
CommandType = commandType;
}
public Type CommandType { get; } = null;
}
}