Hangfire does not reconstruct whole information for invoked job method?

Tags: #<Tag:0x00007f2358cf34b0>

I’m trying to create Distributed lock based both on method name and its parameters. For that, I had to copypaste functionality and to change GetResourceName.Though, information about parameters attributes is not present (GetCustomAttributes is empty). Does it have something to do with how Hangfire reconstructs method via reflection - i.e. some input information is lost (not serialized)?

private static string GetResource(Job job)
{
    var argsSalt = new StringBuilder();
    if (job.Args != null && job.Args.Count > 0)
    {
        var jobArgs = job.Args.ToArray();
        var jobMethodParameters = job.Method.GetParameters().ToArray();

        for (var pos = 0; pos < jobMethodParameters.Length; pos++)
        {
            if (jobMethodParameters[pos].GetCustomAttributes(typeof(DisableConcurrentExecutionKeyAttribute), false).Any())
            {
                var properties = jobArgs[pos].GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
                foreach (var property in properties)
                {
                    argsSalt.Append($".{property.GetValue(jobArgs[pos], null)}");
                }
            }
        }
    }

    return $"{job.Type.ToGenericTypeString()}.{job.Method.Name}{argsSalt}";
}

Method signature is:

public async Task InitAsync([DisableConcurrentExecutionKeyAttribute] FullBatchKeyDto batchKey)