-1

I'm using Web API 2 for mobile clients. Web API uses "Individual Accounts" for authenticate in my project. I created database with MSSQL on remote server and my API 's structe likes "Wep API 2 + MSSQL" (Database First). But "Individual Accounts" uses "Code First" so uses local db. I don't want this. I want to use database on remote MSSQL with "Web API 2". How can I do this?

mypolat
  • 197
  • 1
  • 1
  • 8

1 Answers1

3

change the following line in IdentityModel.cs

public ApplicationDbContext()
            : base("DefaultConnection")

to

public ApplicationDbContext()
            : base("YourConnectionStringsName")
oansari
  • 325
  • 2
  • 7
  • Additionally to the post above you should have a look at this [thread](http://stackoverflow.com/questions/21343846/change-the-database-in-which-asp-net-identity-stores-user-data/21344228#21344228). You only have to do two things: Add the connection string of your remote DB to your web.config and change the call to the base class in the constructor of your context (like shown above). – Horizon_Net May 11 '14 at 12:04