Json error in C#

lokiys

Moderator
Joined
Feb 1, 2012
Messages
4,920
Reaction score
1,203
Points
113
I suppose it is not version related. But such C# code returns me error:
return project.Json.modriadata.asm-_prop-city;
Error in action "CS0103" "The name 'city' does not exist in the current context". [Row: 0; Column: 42]
When I use action set to variable {-Json.modriadata.asm-_prop-city-}
All works good.
 

VladZen

Administrator
Staff member
Joined
Nov 5, 2014
Messages
22,829
Reaction score
6,040
Points
113
Symbol "-" can't be used for name in C#.
 

VladZen

Administrator
Staff member
Joined
Nov 5, 2014
Messages
22,829
Reaction score
6,040
Points
113
You may use the following method to get this variable:
Code:
project.Json.modriadata.GetMember("asm-_prop-city");
 
  • Thank you
Reactions: lokiys and Alex733

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)