I can better explain my problem by code
here it is
strind abc="12345678<9";
row1ViewModel data = new row1ViewModel();
data.identityType = abc[0].ToString();
data.passportType = abc[1].ToString();
data.issuingOrg = abc.Substring(2, 3);
var actual = "";
data.lastName = actual;
//data.lastName = actual;
if (abc[5] == '<')
{
actual = "Not specified";
}
else
{
string tempq = abc.Substring(5);
int index = tempq.IndexOf('<');
actual = abc.Substring(5, index);
}
//data.GetType().GetProperty(data.lastName).GetValue(actual,null)
Here I need to set my property (data.lastname of string type) to a string actual value. But how?
You need to move your
to after your else loop, if im reading your logic correct.