I am building my first MVC 5 / Entity Framework application. I used the database first method to pull in my data from an existing SQL server. The existing SQL database receives it's data from a separate web forms .net application.
Moving forward, the new MVC application and the existing web forms application will share the database.
I am using Identity to create user accounts within the MVC application. So at this point, I have 2 data connections in my MVC application. One for the user accounts and the other for the existing SQL server.
Is this the best way to set up the MVC project? Moving forward, will I be able to access the user database from the web forms application?
I am a newbie, and I want to make sure I am setting this up correctly.
If you want to connect to the SQL database into ASP.NET, using C#, it should follow the steps given below. Now, Open Visual Studio 2015 Update 3, go to the File >> New >> Project or use the shortcut key "Ctrl+Shift +N". Here, select Visual C# >> Web >> ASP.NET Web Application. Finally, click "OK" button.
Add OWIN startup and authentication configuration classesIn Solution Explorer, right-click your project, select Add, and then Add New Item. In the search text box dialog, type "owin". Name the class "Startup" and select Add.
Will there the user tables be added to the existing sql server, or is this user database a completely separate database?
You do not need two databases - you can create Identity tables inside your existing database.
ASP.Net Identity uses Entity Framework Code First. Therefore, before running your application first time, you want to update Connection String same as existing database which is normally inside ApplicationDbContext.
If you already have two separate databases and want to merge them, you want to use tools such as RedGate - SQL Compare and Data Compare.
Merging two database is totally out of original question; please kindly create a separate question if you have one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With