Skip to content

Instantly share code, notes, and snippets.

@jongalloway
jongalloway / CreateAdminUser.cs
Created August 23, 2012 06:11
I wanted to create an administrative user in an MVC 4 tutorial using a drop in code file (just throw in App_Start folder and it'll create the user on first run). Normally I'd use WebActivator for PostApplicationStart, but I wanted to make this just a simp
using Mvc4SampleApplication.Filters;
using System.Web;
using System.Web.Security;
using WebMatrix.WebData;
[assembly: PreApplicationStartMethod(typeof(PreApplicationTasks), "Initializer")]
public static class PreApplicationTasks
{
public static void Initializer()