V
V
Vladimir Karpenko2017-04-19 19:41:47
PHP
Vladimir Karpenko, 2017-04-19 19:41:47

What if there are two databases in an ASP.NET MVC5 project: one is database first, the other is code first?

I am writing a culinary website on the ASP.NET MVC5 platform. Solution consists of 2 projects:
1) Domain, which uses EF database first to store information about recipes.
2) Web.UI, which defines the application logic.
Added an ASP.NET Identity 2.0 authorization system to the site in the Web.UI project, which can only use EF code first.
The result is two databases.
How to be? Leave as is? Or merge these two databases into one? If yes, how to do it?
I also want to create a personal account for users, add the ability to comment on recipes, and publish my recipes. Accordingly, what if, information about users is in one database, and about recipes in another?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yan-s, 2018-04-30
@Yan-s

https://stackoverflow.com/questions/2852748/pdoexc...

Z
Zelimkhan Beltoev, 2017-04-19
@Beltoev

Added an ASP.NET Identity 2.0 authorization system to the site in the Web.UI project, which can only use EF code first.

Where did you get that only code first?
ASP.NET is a very flexible framework and it's quite easy to override the user repository class that Identity would use there. Store everything in one database.

R
Roman, 2017-04-20
@yarosroman

For an existing database, you can write a Code First model and that's it. We do Add - Element, in the data we select the ADO.Net EDM Model, and in the next window Code First from the database. And what prevents it from being completely done in Code First, and then transferring data from the old one to the new database?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question