Skip to content

Instantly share code, notes, and snippets.

@uluhonolulu
Created June 24, 2011 07:28
Show Gist options
  • Save uluhonolulu/1044383 to your computer and use it in GitHub Desktop.
Save uluhonolulu/1044383 to your computer and use it in GitHub Desktop.
FubuMVC demo registry
using System;
using System.Web;
using FubuDemo.Greetings;
using FubuMVC.Core;
using FubuMVC.Spark;
namespace FubuDemo {
public class ConfigureFubuMVC : FubuRegistry {
public ConfigureFubuMVC() {
// This line turns on the basic diagnostics and request tracing
IncludeDiagnostics(true);
// All public methods from concrete classes ending in "Controller"
// in this assembly are assumed to be action methods
Actions.IncludeClassesSuffixedWithController();
// Policies
Routes
.HomeIs<SayController>(controller => controller.Hi())
.IgnoreControllerNamespaceEntirely();
//Use Spark :)
this.UseSpark();
// Match views to action methods by matching
// on model type, view name, and namespace
Views.TryToAttachWithDefaultConventions();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment