I came across a code section where the method declaration is as shown below;
public MethodName(
ISessionAwareRepo<MCC_Message> param1,
ISessionAwareRepo<MCC_User> param2,
ISessionAwareRepo<MCC_Directory> param3,
ISessionAwareRepo<MCC_MessageInDirectory> param4,
ISessionAwareRepo<MCC_Conversation> param5,
ISessionAwareRepo<MCC_MessageRecipient> param6)
: this(null, param1, param2, param3,
param4, param5, param6)
I do not understand what does :this stand for in the method declaration. Can anyone please help?
This is called constructor chaining.
There is an overload of the constructor within the same class – the parameters are being passed in to the overload (so it gets executed before the body of the declaring constructor).
See Using Constructors on MSDN for more details.