Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I created an empty project (MVC) but now want user roles and profiles tables added to my db

When you create an MVC Application with Windows Authentication, it adds roles and what not to your database tables... How do you add those in manually if you have created the project as an empty project?

I have run:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe 

inside packagemanager but it has made the old versions

aspnet_blabla

.... Oh god, there's so many tables and views added (cries self to sleep)

I found http://msdn.microsoft.com/en-us/library/ms229862(v=vs.100).aspx#findingthecorrectversion which pretty much says the usual stuff that ends up placing the crazies in my database. :'(

is there anything wrong with using the aspnet_blabla tables?

like image 491
Jimmyt1988 Avatar asked Dec 16 '13 20:12

Jimmyt1988


1 Answers

There are three main implementations of membership (and roles) in the default Microsoft stack. In order of coolness (i.e. newest to oldest), they are:

ASP.NET Identity

This is the new coolness, released in tandem with VS2013. It is a simplified system implemented with EF Code First, and should be pretty easy to plug into any project. Here is a walkthrough of doing just that. All of the project templates in VS2013 use this.

Simple Membership

Is a light-weight implementation of the Membership Provider model (more below). As the original implementation was cumbersome, this tried to alleviate some of that. It is more compatible with older WebForms stuff. This was the best link I could find.

ASP.NET Membership Provider

This is the model that shipped with .NET 2.0 and has a gigantic schema. You can create the schema in your database with the aspnet_regsql tool.

like image 196
Jimmy Avatar answered Oct 13 '22 13:10

Jimmy