Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
I think Linq is your friend:
// Easy to sort using Linq
var blogs = MethodThatGetsBlogCollection();
var sortedBlogs = blogs.OrderBy(b => b.Header);
// If you cant use the IEnumerable sortedBlogs but need a BlogCollection, you have to loop...:
var sortedBlogCollection = new BlogCollection();
foreach (var blog in sortedBlogs)
{
sortedBlogCollection.Add(blog);
}
The Linq-expression did the trick. I have to study linq more, seems that it solves alot of problems. Thanks!
/Peter
Hi
Is it possible to sort a BlogCollection by property, like you can sort a PageDataCollection with FilterPropertySort? I'm trying to find a nice way to sort blogs by their name.
/Peter