Q:

HttpClient and JSON with arrays

I want to parse JSON file, when I'm doing it with JSON without arrays everything is ok but when I'm trying to do this with JSON with arrays I got unhandled exceptions.
My JSON:
{  
   "odata.metadata":"http://212.182.24.861:12345/DataService.svc",
   "value":[  
      {  
         "Event_p":[  

         ],
         "Id":1,
         "Status":0,
         "Name":"test"
      },
      {  
         "Event_p":[  

         ],
         "Id":2,
         "Status":0,
         "Name":"test"
      }
   ]
}

My task:
public async Task<IEnumerable<Event>> LoadEvents()
{
    HttpClient httpClient = new HttpClient();
    var response = await httpClient.GetAsync("address");

    var jsonString = await response.Content.ReadAsStringAsync();
    var values = JsonConvert.DeserializeObject<ObservableCollection<Event>>(jsonString);

    return values;
}

My model, at this point I want only to get name.
public class Event : INotifyPropertyChanged
{
    private string _name;

    public string Name
    {
        get { return _name; }
        set
        {
            if (_name == value)
            {
                return;
            }

            _name = value;
            RaisePropertyChanged("Name");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void RaisePropertyChanged(string propertyName)
    {
        var handler = PropertyChanged;
        if (handler != null)
        {
            handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

A:

If you don't want to rewrite your Event class, you can also manually parse the JSON response using LINQ to JSON provided by JSON.NET:
var parsed = JObject.Parse(jsonString);
var events = parsed["value"].Select(
    e => new Event { Name = e["Name"].ToString() });

var values = new ObservableCollection<Event>(events);

Or perhaps a little bit cleaner:
var values = JObject.Parse(jsonString)["value"].ToObject<ObservableCollection<Event>>();

