Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AhmedKamal/06968a408487c3fd0b3e to your computer and use it in GitHub Desktop.
Save AhmedKamal/06968a408487c3fd0b3e to your computer and use it in GitHub Desktop.
public static List<NewsStory> GetNewsStoriesFromClusters(IQueryable<Cluster> clusters)
{
List<NewsStory> result = new List<NewsStory>();
clusters.ToList<Cluster>().ForEach(x => result.Add(new NewsStory
{
LastUpdate = x.LastUpdate
,
CategoryID = x.Category.CategoryID,
ClusterID = x.ClusterID,
Items = from e in de.Items
where e.ClusterID == x.ClusterID
select e
}));
return result;
}
public class NewsStory
{
public IQueryable<Item> Items { get; set; }
public Nullable<long> CategoryID { get; set; }
public System.DateTime LastUpdate { get; set; }
public int ClusterID { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment