Skip to content

Instantly share code, notes, and snippets.

View gist:1854093
public class NavController : Controller
{
public PartialViewResult Menu()
{
var controllers = new List<string> {
"Home", "Page", "User"
};
return PartialView(controllers);
}
@gregerhalltorp
gregerhalltorp / gist:1853953
Created Feb 17, 2012
Custom type converter for converting between MongoDB.Bson.ObjectId and string
View gist:1853953
public class ObjectIdConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context,
Type sourceType)
{
if (sourceType == typeof(string))
return true;
return base.CanConvertFrom(context, sourceType);
}
You can’t perform that action at this time.