Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / web.config
Created November 19, 2012 15:47
Getting Started with FubuMVC Again
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
@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 / 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 / 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)
public class AcceptPrivacyPolicyRedirector
{
private readonly ISession _session;
public AcceptPrivacyPolicyRedirector(ISession session)
{
_session = session;
}
public FubuContinuation Execute(UserRequestInputModel input)
public class AcceptPrivacyStatementPolicy : IConfigurationAction
{
public void Configure(BehaviorGraph graph)
{
graph.Actions()
.Where(x => x.RequiresAuthentication())
.Each(x => x.WrapWith<AccceptPrivacyPolicyRedirector>());
}
}
public class AcceptPrivacyPolicyRedirector : IActionBehavior
{
private readonly ISession _session;
private readonly IFubuRequest _fubuRequest;
private readonly IContinuationDirector _continuationDirector;
private readonly IActionBehavior _inner;
public AcceptPrivacyPolicyRedirector(ISession session, IFubuRequest fubuRequest, IContinuationDirector continuationDirector, IActionBehavior inner)
{
_session = session;
@CoreyKaylor
CoreyKaylor / App.config
Created October 15, 2012 22:51
RSB 3.0.0 Configuration
<rhino.esb>
<assemblies>
<add assembly="Rhino.ServiceBus.RhinoQueues" />
</assemblies>
<bus threadCount="1"
numberOfRetries="5"
endpoint="rhino.queues://localhost/test_queue"
queueIsolationLevel="ReadCommitted"
/>
<messages>