Before updating scaffolding from new db schema

Posted by / 27-Feb-2020 22:42

Before updating scaffolding from new db schema

The problem can be that some predefined databases can have aspects that are awkward to deal with from the software side.

As a software developer, my choice of database access tool is Microsoft’s Entity Framework (EF) so I am motivated to see how EF can handle this.

Having sorted the scaffolding as discussed above then just repeat step 1, ‘Creating the Entity Framework Classes from the existing database’.

One warning about using importing scaffolding – Visual Studio threw a nasty error message when I first tried to import using the scaffolding (see stackoverflow entry).

It took a bit of finding but it turns out if you have Entity Framework Power Tools Beta 4 installed then they clash.

The aim is to show how you can use EF with pre-existing databases, including ones that need direct access to T-SQL commands and/or Stored Procedures.

Entity Framework has a well-documented approach, called reverse engineering, to create the EF Entity Classes and from an existing database.

before updating scaffolding from new db schema-56before updating scaffolding from new db schema-36before updating scaffolding from new db schema-69

However I did have a couple of problems: As I said earlier the standard templates enable ‘lazy loading’.