How should I manage multiple database contexts?

I have built a console application that generates data for me. I am using EF6 code first and as a solo developer working on this alone that is very convenient for me as I am no database expert.

I now want to create an ASP.NET application that will present some of my data but will also have its own data relevant only to the ASP.NET app.

I am kind of confused how I should set this up. The thing I love about code first is, as it is just me using it, I enable automatic migrations and I can be pretty maverick changing things.

Should I build the ASP.NET app in my usual code first approach and then add a second database first context to get access to my console apps database? When I update the database structure in my console app will it cause me issues with the database first context in the ASP.NET app?

I very rarely use database first and I’ve never had more than one context in a project so your advice is greatly appreciated.

submitted by /u/Mr_Nice_
[link] [comments]

Leave a Reply