ErikEJ / erikej.github.io

ErikEJ blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entity Framework Core SQL Server reverse engineering a.k.a Database First gotchas (and workarounds)

ErikEJ opened this issue · comments

Hi Erik,
I'm trying to use the 'Saving options and running the second time' for reverse engineering (outlined here: https://github.com/ErikEJ/EFCorePowerTools/wiki/Reverse-Engineering). I've saved a second config file in my root project directory and so now I have two: 'efpt.config.json' and 'efpt.models.config.json'. I can't seem to be able to access the 'efpt.models.config.json' configuration with the EF Core Power Tools -> Reverse Engineer menu option. Is there any instructions on how to manage multiple configuration files?
Sorry if this has been documented somewhere.... I have been searching for a while and haven't been able to find a way to solve my own problem.
Sandy
RASA Consulting

You need to use the latest daily build.

OK thanks - I'll give that a go.

The multiple config files work a treat thanks.

[details included below for anyone else trying to do the same thing]
I've managed to use these to split database tables into 'Entities' folder and database views into a 'Models' folder in my data api project by having 3 config files - one for the DbContext Only generation and one EntityTypes Only for my classifications of 'Entities' and 'Models'. I had to do a small work-around with the namespace in the DbContext config file in the 'EntityTypes path' field to ensure both using statements were included having something like this "Entities; using Project.Data.Models" (see image attached).

Thanks again ErikEJ - it's a great tool.

Screen Shot 2020-10-25 at 6 44 57 am