Caller Info Attributes is a new feature in C# 5.0, Caller Info Attributes instructs the compiler to obtain and feed information into the parameter’s default value. You can tag optional parameters using Caller Info Attributes.
- [CallerMemberName] – It applies the caller’s member name
- [CallerFilePath] - It applies the path to the caller’s source code file
- [CallerLineNumber]- It applies the line number in the caller’s source code file
C:\Projects\Program.cs (Assuming your project is located in this path)
Caller Info attributes are useful for writing logging functions and for implementing change notification patterns. The following method can be called from property’s set accessor