I have written a class like below
public sealed class SomeAttribute : Attribute, IResultFilter
{
private INotificationhub notificationHub;
public void OnResultExecuting(ResultExecutingContect filterContext)
{
//Need to set value notificationHub by resolving dependency
//some other logic here
}
}
in ConfigureServices of asp.net core
I have written
services.AddSingleton<INotificationHub, NotificationHub>();
How can I resolve the dependecy in the attribute class. I cannot do a constructor injection.