Skip to content

Instantly share code, notes, and snippets.

View XiXora's full-sized avatar

Damon Stephenson XiXora

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Pauwels.AspNet
public class ContextFactory : IContextFactory
{
public DbContext GetCurrentContext()
{
DbContext context = HttpContext.Current.Items["CurrentContext"] as DbContext;
if (context == null)
{
DbProviderInfo providerInfo = new DbProviderInfo("System.Data.SqlClient", "2008");
DbModelBuilder modelBuilder = new DbModelBuilder();