TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

Scaffold EF Core models using Handlebars templates.
MIT License
209 stars 53 forks source link

Q: multiple DBs. Each DB with own ScaffoldingDesignTimeServices and templates #83

Closed MyEidos closed 4 years ago

MyEidos commented 4 years ago

Hi. It it possible to store multiple DB contexts in one class library independently? So each DB will have own settings.

tonysneed commented 4 years ago

This is a question for EF Core, so I would advise posting your question there.

You pass the DB connection string to the dotnet ef command, so you can specify whatever DB you want. However, I think only one design time services class is allowed in a project. I could be wrong, however, so I suggest you post your question on the EF Core repo.

MyEidos commented 4 years ago

Okay. Thank you. Solved with independent class library for each DB. And saving context/entities to another folder. Like "$ dotnet ef dbcontext scaffold "" Microsoft.EntityFrameworkCore.SqlServer -o "../EntitiesDir" -c Context -f --context-dir "../Contexts"