Is performance hit by using Caller Information attributes?

The caller information attributes cause the C# compiler to supply the caller’s name at the callsite. This happens at compile-time, there is no reflection involved.

public void DoProcessing()
{
    LogCall();
}

public void LogCall([CallerMemberName] string memberName = "")
{
     Console.WriteLine(memberName + " was called.");
}

Will be compiled to:

public void DoProcessing()
{
    LogCall("DoProcessing");
}

public void LogCall(string memberName)
{
     Console.WriteLine(memberName + " was called.");
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)