I have a result as JSON string
[{"GROUP_MOD_ID":"G02","ADD":1,"EDIT":0,"DEL":1,"VIEW":null,"UP":1,"PRINT":null,"ADMIN":null,"MOD":null,"ADD-AD":null,"EDIT-AD":null,"DEL-AD":null,"VIEW-AD":null}]
Ok, I want to get name and value do something as
public static bool Check(string group_mod_id)
{
var obj = GroupModBus.GetGroupModFunc(group_mod_id);
if (obj != "[]")
{
if (obj.Contains["ADD"]=="1")
{
//do something
return true;
}
}
else
return false;
}
It's get error Error 1 Cannot apply indexing with [] to an expression of type 'method group'
NOTEs: In here dynamic data, not in a instance.Normally, if data in one instance, I can use like this
public class EXAMPLE
{
public string ADD { get;set;}
public string EDIT {get;set;}
///etc....
}
///using as
if (obj.ADD =="1")
{
//do something
return true;
}
I think i should convert JSON string to array , then get name and get value .Do you think so ?