1

In Visual Studio 2013 i have a web api solution with 2 project:

1)StrokeInModel(that is entity framework database first)

2)MyProject (Web Api 2 with Individual Accounts project with reference to StrokeInModel project to access to the database)

Now i have changed the connection string in the Web.config to connect to my existing database:

<add name="StrokeInEntities" connectionString ......... />

And in the "StrokeInModel.Context.cs" i have the following code:

public partial class StrokeInEntities : DbContext
{
    public StrokeInEntities()
        : base("name=StrokeInEntities")
    {
    }
    ...
}

Now, for example, when i call this url:

http://localhost:port/api/Account/Register

passing this parameter as POST:

{
 "UserName": "Alice",
 "Password": "password123",
 "ConfirmPassword": "password123"
}

seems that the registration is Ok. Anyway i can't see in the SQL Server Management the table where the user's username and password are stored in the existing database. If i recall the registration with the same parameters there's an error that the user is yet registered. Where is the user table in the existing database? (I don't have added any tables)

In the server explorer window i see the connection to my database with all my tables but don't see the user table!! So where is stored the user's signup information?

enter image description here

Community
  • 1
  • 1
Tom
  • 4,007
  • 24
  • 69
  • 105
  • I have seen that the user is created under the LocalDB under DefaultConnection database!! How is it possible if i have changed the connection strings? – Tom May 20 '14 at 16:25

1 Answers1

1

Because the IdentityDbContext use the default connection string named "DefaultConnection", so you will have to change it as well.

More from here

Why is Asp.Net Identity IdentityDbContext a Black-Box?

Community
  • 1
  • 1
Toan Nguyen
  • 11,263
  • 5
  • 43
  • 59