I am using Entity Framework and an onion architecture to make my website maintainable and persistent. Now as I followed a particular onion architecture example, I ended up with:
- Domain (entities, and domain interfaces)
- Repository (IRepo, and Repo etc...)
- Service (established a link between UI and Repo, to respect SoC (if I got it correctly) etc ...)
- UI (in my case an MVC project)
Now I have separated my Entity Framework entities from my context. Entities go in the domain whereas the context goes in the repository. This means that when I enabled migrations, the configuration.cs file has been added to migrations folder in Domain
but now since Domain
has no dependencies, I have no access to my context (it is in a higher layer, therefore that would violate onion architecture rules (dependencies can't go outwards)).
- Should I move my migrations folder to repository ?
- Should I
enable-migrations
in repository ? - My
configuration.cs
file is very thin, is it mandatory to keep it (it does keepAutomaticMigrationsEnabled
to false which makes me doubt this, seems like something lazy to do but who knows)?
Thanks for help!