While creating a custom attribute of "AttributeTargets.Parameter" constructor is not called. I want to use the parameter value of Fn function under Test Class. I used .net core and .net standard.
class Program
{
public static void Main()
{
var test = new Test();
test.Fn("Hello");
Console.WriteLine("end");
Console.Read();
}
}
public class Test
{
public void Fn([Parameter] string parm)
{
Console.WriteLine(parm);
}
}
[AttributeUsage(AttributeTargets.Parameter)]
public class ParameterAttribute : Attribute
{
public ParameterAttribute()
{
Console.WriteLine("In Parameter Attribute");
}
}