This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using FubuMVC.Core; | |
using FubuMVC.StructureMap; | |
using StructureMap; | |
namespace HelloWorld | |
{ | |
public class Global : System.Web.HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<viewdata model="HelloWorld.Features.Home.HomeViewModel" /> | |
<h1>Hello ${Model.Message}</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using FubuMVC.Core; | |
using HelloWorld.Features.Home; | |
namespace HelloWorld | |
{ | |
public class HelloWorldRegistry : FubuRegistry | |
{ | |
public HelloWorldRegistry() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.webServer> | |
<modules runAllManagedModulesForAllRequests="true" /> | |
</system.webServer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>title</title> | |
</head> | |
<body> | |
<header><h1>Hello from Layout</h1></header> | |
<div> | |
@RenderBody() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> | |
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> | |
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> | |
</sectionGroup> | |
</configSections> | |
<system.web> | |
<compilation debug="true" targetFramework="4.5"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model FeatureToggleSample.HomeModel | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Toggling Features</title> | |
</head> | |
<body> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FeatureSettings | |
{ | |
public bool SpecialFeatureEnabled { get; set; } | |
public bool SomeOtherFeatureEnabled { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FeatureToggleRegistry : Registry | |
{ | |
public FeatureToggleRegistry() | |
{ | |
Scan(x => | |
{ | |
x.TheCallingAssembly(); | |
x.Convention<SettingsConvention>(); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SendEmailNowBehavior<TResponse> : IActionBehavior | |
where TResponse : RenderEmailBase | |
{ | |
private readonly IOutputWriter _outputWriter; | |
private readonly IFubuRequest _fubuRequest; | |
private readonly IMailer _mailer; | |
public SendEmailNowBehavior(IOutputWriter outputWriter, IFubuRequest fubuRequest, IMailer mailer) | |
{ | |
_outputWriter = outputWriter; |