Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View gregerhalltorp's full-sized avatar
😀

Greger Hälltorp gregerhalltorp

😀
View GitHub Profile
@gregerhalltorp
gregerhalltorp / gist:1854093
Created February 17, 2012 15:45
Menu rendering
public class NavController : Controller
{
public PartialViewResult Menu()
{
var controllers = new List<string> {
"Home", "Page", "User"
};
return PartialView(controllers);
}
@gregerhalltorp
gregerhalltorp / gist:1853953
Created February 17, 2012 15:06
Custom type converter for converting between MongoDB.Bson.ObjectId and string
public class ObjectIdConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context,
Type sourceType)
{
if (sourceType == typeof(string))
return true;
return base.CanConvertFrom(context, sourceType);
}