I currently have the 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 get the value, we use the following code,
eg.
int valPayStatus = GetVariableValue(objTaxretrun, TaxReturnIdentity.aadata_identity_paystatus)
It has worked fine so far since all Identity values ββwere Integer, but recently we have added new identifiers with the String and Boolean types. So I want to make the Generic function above ... but I donβt know how to do it, I tried to do a google search, but didn't find anything.
source share