using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
public static class Collections
{
public static ObservableCollection ToObservableCollection(this IEnumerable enumerableList)
{
if (enumerableList != null)
{
//create an emtpy observable collection object
var observableCollection = new ObservableCollection();
//loop through all the records and add to observable collection object
foreach (var item in enumerableList)
observableCollection.Add(item);
//return the populated observable collection
return observableCollection;
}
return null;
}
}