CSharp · Console
using System;
using Newtonsoft.Json;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
var json = @"[
{
""cuid"":""1338857734894"",
""invitationStatus"":""invite_accepted"",
""isEnabled"":true,
""userProperties"":
{
""name"":
{
""familyName"":""Smith"",
""givenName"":""John""
},
""email"":""[email protected]"",
""mobile"":""(111) 333-4444"",
""role"":""Developer"",
""specialty"":""Development"",
""department"":""IS""
}
}
]";
var root = JsonConvert.DeserializeObject<IEnumerable<RootObject>>(json);
root.Dump();
}
public class Name
{
public string familyName
{
get;
set;
}
public string givenName
{
get;
set;
}
}
public class UserProperties
{
public Name name
{
get;
set;
}
public string email
{
get;
set;
}
public string mobile
{
get;
set;
}
public string role
{
get;
set;
}
public string specialty
{
get;
set;
}
public string department
{
get;
set;
}
}
public class RootObject
{
public string cuid
{
get;
set;
}
public string invitationStatus
{
get;
set;
}
public bool isEnabled
{
get;
set;
}
public UserProperties userProperties
{
get;
set;
}
}
}