How to deserialize a string into a class?

EvelynJ

New Member
I have the below text:\[code\]id=1familyName=RooneygivenName=WaynemiddleNames=MarkdateOfBirth=1985-10-24dateOfDeath=placeOfBirth=Liverpoolheight=1.76twitterId=@WayneRooney\[/code\]Lines are separated by "\n" and pairs are separated by "=".I have a Person class with properties like Id, FamilyName, GivenName, etc.Is there any easy way to deserialize the above text into a Person object and later serializing a Person object to the above text with the correct line and pair separators?I hoped there could be something like a TextSerializer?Basically, I'd need to read a text from a file e.g. person1.txt then deserialize it into a Person object.I'd like to avoid hardcoding it manually for each property if possible.Thanks,
 
Back
Top