Skip to content

Instantly share code, notes, and snippets.

@CoreyKaylor
CoreyKaylor / Global.asax.cs
Created November 18, 2012 03:11
Getting Started with FubuMVC Again
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)
@CoreyKaylor
CoreyKaylor / Home.spark
Created November 18, 2012 03:38
Getting Started with FubuMVC Again
<viewdata model="HelloWorld.Features.Home.HomeViewModel" />
<h1>Hello ${Model.Message}</h1>
@CoreyKaylor
CoreyKaylor / HelloFubuRegistry.cs
Created November 18, 2012 03:50
Getting Started with FubuMVC Again
using System;
using FubuMVC.Core;
using HelloWorld.Features.Home;
namespace HelloWorld
{
public class HelloWorldRegistry : FubuRegistry
{
public HelloWorldRegistry()
{
@CoreyKaylor
CoreyKaylor / web.config
Created November 19, 2012 15:47
Getting Started with FubuMVC Again
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
@CoreyKaylor
CoreyKaylor / Application.cshtml
Created December 9, 2012 05:30
Razor Hello Templates
<!DOCTYPE html>
<html>
<head>
<title>title</title>
</head>
<body>
<header><h1>Hello from Layout</h1></header>
<div>
@RenderBody()
@CoreyKaylor
CoreyKaylor / gist:4243501
Created December 9, 2012 05:51
Razor web.config
<?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">
@CoreyKaylor
CoreyKaylor / Home.cshtml
Created February 16, 2013 23:55
View for ContentExtension feature toggle.
@model FeatureToggleSample.HomeModel
<!DOCTYPE html>
<html>
<head>
<title>Toggling Features</title>
</head>
<body>
<div>
@CoreyKaylor
CoreyKaylor / FeatureSettings.cs
Last active December 13, 2015 20:19
Feature toggle boilerplate
public class FeatureSettings
{
public bool SpecialFeatureEnabled { get; set; }
public bool SomeOtherFeatureEnabled { get; set; }
}
@CoreyKaylor
CoreyKaylor / FeatureToggleRegistry.cs
Last active December 13, 2015 20:19
StructureMap magic to make AppSettings suck less.
public class FeatureToggleRegistry : Registry
{
public FeatureToggleRegistry()
{
Scan(x =>
{
x.TheCallingAssembly();
x.Convention<SettingsConvention>();
});
}
@CoreyKaylor
CoreyKaylor / SendEmailBehavior.cs
Created February 18, 2013 15:44
Gimped sample of sending an email with fubu
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;