Currently i am having following function
public int GetVariableValue(TaxReturn taxReturnObj, string identityKey)
{
int returnTypeOut = 0;
if (taxReturnObj.Identity.ContainsKey(identityKey))
{
int.TryParse(taxReturnObj.Identity[identityKey], out returnTypeOut);
}
return returnTypeOut;
}
To retrieve the value we are using following code,
e.g.
int valPayStatus = GetVariableValue(objTaxretrun, TaxReturnIdentity.aadata_identity_paystatus)
It was working fine untill now as All the Identity Values were Integer,but recently we have added New Identites with String and Boolean types.
So i want to make the above function as Generic…but i don’t know how to go about that,I tried to search on google but couldn’t find anything.
1 Answer