I have a constructor in my windows forms
public frmSecondarySEC(int intPrimaryDocumentId, int intSecondaryDocumentId, string strStateCode, int intCountyId, string strPrimaryDocTypeName, string strPrimaryDocTypeCode, string strDealName, string strLoanNumber, int intDealId, string strDealType, string strCountyName, bool blIsFileReview)
{
}
Now i need to pass an extra parameter to this constructor. For this i created an overloaded version of this constructor so that other classes using the original constructor does not break up.Only difference is addition of new parameter.
public frmSecondarySEC(int intPrimaryDocumentId, int intSecondaryDocumentId, string strStateCode, int intCountyId, string strPrimaryDocTypeName, string strPrimaryDocTypeCode, string strDealName, string strLoanNumber, int intDealId, string strDealType, string strCountyName, bool blIsFileReview,string primaryDocumentTitle)
{
}
Now since they share commom initialization code, i tried constructor chaining
public frmSecondarySEC(int intPrimaryDocumentId, int intSecondaryDocumentId, string strStateCode, int intCountyId, string strPrimaryDocTypeName, string strPrimaryDocTypeCode, string strDealName, string strLoanNumber,int intDealId, string strDealType, string strCountyName, bool blIsFileReview) : this(int intPrimaryDocumentId, int intSecondaryDocumentId, string strStateCode, int intCountyId, string strPrimaryDocTypeName, string strPrimaryDocTypeCode, string strDealName, string strLoanNumber, int intDealId, string strDealType, string strCountyName, bool blIsFileReview)
{
}
However I am getting an error on this part
:this(int intPrimaryDocumentId
which says
Invalid expression term ‘int’ .Am i using a wrong implementation of constructor chaining or it can be done some other way. I want to prevent duplication of code. Please suggest.
It knows the type, just pass the parameter.