IrishChieftain
IrishChieftain

Reputation: 15253

How to Create Identity DB

I have a ASP.NET 4.5 Web Forms project already created in VS2013. I used Nuget to include Entity Framework (not familiar with this), Identity, Core, etc.

I am not using LocalDb or Express; I am using SQL Server 2012 on my dev machine. I am using Windows Authentication locally.

I have an existing empty DB called DTC. I went to CodePlex, which had zero documentation as usual, and downloaded the VS SQL Server DB project:

http://identity.codeplex.com/

I "published" it to create the DB script, as described here.

Here is the output in VS:

Writing model to C:\Development\ASP.NET Identity Database v2.0.0\obj\Debug\Model.xml...
    Database -> C:\Development\ASP.NET Identity Database v2.0.0\bin\Debug\KriaSoft.AspNet.Identity.Database.dll
    Database -> C:\Development\ASP.NET Identity Database v2.0.0\bin\Debug\Database.dacpac
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

When I clicked the Publish button, the membership tables were created in my DB successfully.

Question

It looks like these files were created in the database project folder; do I need to include these in my Web Forms project? Can someone provide me with an overview of what I need to get a basic Identity membership system working - just registration details and an admin role, no profiles involved?

UPDATE 07-23-2014

I've figured out that I will be using EF and have located code samples on the ASPNET website. What I really need to know is if this should be database-first, code-first (or model first?) and why would I need to go to CodePlex to download a DB first version? Does Microsoft not provide an out-of-the-box DB schema for basic membership with Identity? Every article I find online is based on MVC...

Upvotes: 2

Views: 2064

Answers (1)

IrishChieftain
IrishChieftain

Reputation: 15253

According to the ASPNET Identity Roadmap:

"By default, the ASP.NET Identity system stores all the user information in a database. ASP.NET Identity uses Entity Framework Code First to implement all of its persistence mechanism."

To me this is pretty lame, not to offer alternatives such as DB-first. Now I see the value in this project which offers a DB-first alternative.

https://github.com/kriasoft/AspNet.Identity

Upvotes: 1

Related Questions