Reputation: 9065
dynamic json = new JsonObject();
json.ref.lolCats = GetLolCats();
gives me:
Identifier expected; 'ref' is a keyword
is there a way to escape the keyword using the dynamic syntax?
(so no json["ref"].lolCats
)
Upvotes: 0
Views: 138
Reputation: 11063
ref
is used for reference parameters
. It is a protected keyword. Try using another var name or append @ character before ref.
You can declare variables that use reserved keywords using the @:
private string @int;
Upvotes: 6