Im making a REST Client for a TradeHouse API, it has a giant object with multiple attributes and i want to Convert it into a Class for me to use. For now as i dont want to make my own deserializer im casting it in a "dynamic" and then taking the attributes i want out of it.
foreach (dynamic stash in xdDynObj.stashes)
{
int incrementer = 0;
xStashes.dicStashes.Add(incrementer, new Stash());
Stash workStash = xStashes.dicStashes[incrementer];
workStash.stashAccountName = stash.accountName;
workStash.stashLastCharacterName = stash.lastCharacterName;
workStash.stashID = stash.id;
workStash.stashType = stash.stashType;
workStash.stashLeague = stash.league;
incrementer = incrementer + 1;
}
this for now works as fine as it should. Now there is a problem. The Object im trying to Convert has a Properity called "public" and i definetly need that. but as im trying to get it.
workStash.isStashPublic = stash.public;
it doesnt work as public is obviously a keyword in C#. is there any way to say : Ok please dont take keywords here. or smth like that?
thanks for every help.