public static object ResponseMapper(Dictionary <string, string> keyvals) { var responseobj = new NMIResponse(); var objtype = typeof(NMIResponse); var props = getobjprops <NMIResponse>(); foreach (var prop in props) { foreach (var val in keyvals) { if (prop.ToLower() == val.Key.ToLower()) { objtype.GetProperty(prop).SetValue(responseobj, val.Value); } } } return(responseobj); }
public static string[] ParseResponseString(string response) { var nmiresponse = new NMIResponse(); var items = response.Split('&'); foreach (var item in items) { var propname = DataHelper.GetNMIPropName(item); var stuff = DataHelper.GetPropertyName(() => nmiresponse.AuthCode).ToString(); //switch (item) //{ // case stuff: // break; //} } return(items); }