Cool, Yeah thank you.
The area i'm looking at the moment is to see if i can do something with generics in c#
In the Kigg project you mentioned, i notice they have weight and ranks in there classes and i'm stepping through the code at the moment.
One bit of code i've come across is:
Code:
// Now sort it based upon the score
publishableStories = publishableStories.OrderByDescending(ps => ps.TotalScore).ToList();
// Now assign the Rank
publishableStories.ForEach(ps => ps.Rank = (publishableStories.IndexOf(ps) + 1));
Which goes to this method:
Code:
public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> action)
{
foreach (T item in enumerable)
{
action(item);
}
}
But at the moment i can't see in what way this is ranking the stories?
Am i going in the right direction? Looking at looping through the items in the list using the generics method provided by .net?
Bookmarks