Json error in C#

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 181
Баллы
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
Команда форума
Регистрация
05.11.2014
Сообщения
22 227
Благодарностей
5 844
Баллы
113
Symbol "-" can't be used for name in C#.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 227
Благодарностей
5 844
Баллы
113
You may use the following method to get this variable:
Код:
project.Json.modriadata.GetMember("asm-_prop-city");
 
  • Спасибо
Реакции: lokiys и Alex733

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)