Reputation: 53
Hi all I have a Json class as shown below:
private class RootObject
{
public string flag { get; set; }
public string message { get; set; }
public Result result { get; set; }
}
public class Result
{
public List<List<string>> professions { get; set; }
}
How can I convert the result class into an observable collection?
Upvotes: 5
Views: 3406
Reputation: 1
first of all I have list collection I converted into a I Enumerable collection. after that I returned that collection.
List<string> stringing=new List<string>();
IEnumerable<string> inalterableness=new IEnumerable<string>();
return inalterableness;
Upvotes: 0
Reputation: 3019
ObservableCollection<T>
have constructor which takes IEnumerable<T>
ObservableCollection<string> myCollection = new ObservableCollection<string>(Result);
Upvotes: 6