Implementation of some Underscore.js feature in .NET, using C#