Asp.net web api 我可以将接口实例传递给.net core中的属性吗?

Asp.net web api 我可以将接口实例传递给.net core中的属性吗?,asp.net-web-api,.net-core,attributes,asp.net-core-webapi-2.1,Asp.net Web Api,.net Core,Attributes,Asp.net Core Webapi 2.1,上面是我的类属性。我想在下面的控制器中调用它。是否有方法调用上面的类 public class HMACAuthenticationAttribute : Attribute, IAsyncAuthorizationFilter { public HMACAuthenticationAttribute(IUser user) { ..... } } 看看这个答案,我可以将字符串作为param传递,但无法将接口实例作为param传递。按照这个链接。我们将很容易得到

上面是我的类属性。我想在下面的控制器中调用它。是否有方法调用上面的类

public class HMACAuthenticationAttribute : Attribute, IAsyncAuthorizationFilter
{
   public HMACAuthenticationAttribute(IUser user)  
   {
     .....
   }
}

看看这个答案,我可以将字符串作为param传递,但无法将接口实例作为param传递。按照这个链接。我们将很容易得到答案。检查这个答案。我可以将字符串作为param传递,但无法将接口实例作为param传递。点击这个链接,我们会很容易得到答案。
[HMACAuthentication()]
public class WeatherForecastController : ControllerBase
{
}