0

I have a .NET MVC solution which has got the following projects:

  1. Website - ASP.NET MVC
  2. Core - Services/Data access [UoW, Repository, EF dbcontext]
  3. Database - Visual studio database project (allowing to compare the schema, generate scripts, add pre/post deployment scripts, produces dacpac upon project build)

I am developing/modifying some features and this requires database activities like: table creation/deletion/add column/remove column.

The Core project also has got an edmx file which is the EF data context. I have prior work experience with .NET core based database first projects where-in I would make the db change via SQL management studio and then execute the following command to update the db context Scaffold-DbContext ....

In a non-.NET core project what is the process to update the edmx?

variable
  • 8,262
  • 9
  • 95
  • 215
  • Does this help?: https://stackoverflow.com/questions/9708189/how-do-you-update-an-edmx-file-with-database-changes – Tawab Wakil Jun 29 '22 at 10:38
  • "The Core project also has got an edmx file which is the EF data context." - not quite: it's _for_ the `DbContext` but it's not essential: the EDMX is a design-time generated mapping which is kinda obsolete now: if you use "Code-first-from-database" (with decent codegen templates) then you don't need an EDMX file at all - and stop using the EF Designer. – Dai Jun 29 '22 at 10:39
  • Code first from database means code first or database first? – variable Jun 29 '22 at 11:15
  • "Code-first from Database" basically means using generating scaffolded EF entity types automatically from your existing database design instead of writing those types by hand (i.e. exactly like how Database-first used to work, except without the EDMX file). I use this custom scaffolding tool instead of using EF6 or EF Core's built-in (and not currently customizable...) templates: https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/ – Dai Jun 29 '22 at 19:49

0 Answers0