Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 1.13 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     public class HelloSparkRegistry : FubuRegistry
  2.     {
  3.         public HelloSparkRegistry()
  4.         {
  5.             IncludeDiagnostics(true);
  6.  
  7.             Applies
  8.                 .ToThisAssembly();
  9.  
  10.             Actions
  11.                 .IncludeClassesSuffixedWithController();
  12.  
  13.             Routes
  14.                 .HomeIs<AirController>(c => c.TakeABreath())
  15.                 .IgnoreControllerNamespaceEntirely()
  16.                 .IgnoreMethodSuffix("Command")
  17.                 .IgnoreMethodSuffix("Query")
  18.                 .ConstrainToHttpMethod(action => action.Method.Name.EndsWith("Command"), "POST")
  19.                 .ConstrainToHttpMethod(action => action.Method.Name.StartsWith("Query"), "GET");
  20.                        
  21.             Policies.Add<AntiForgeryPolicy>();
  22.            
  23.             this.UseSpark();
  24.            
  25.             Views
  26.                 .TryToAttachWithDefaultConventions()
  27.                 .TryToAttachViewsInPackages();
  28.  
  29.             HtmlConvention<SampleHtmlConventions>();
  30.  
  31.             Services(s => s.ReplaceService<IUrlTemplatePattern, JQueryUrlTemplate>());
  32.  
  33.             Output.To<SparkHtmlTagOutput>().WhenTheOutputModelIs<SparkHtmlTag>();
  34.         }
  35.     }