Pergunta

I am trying to find a best way to work using Entity Framework and found a recommendation to not have a big models (separate them by intent) because it can make application more complex to maintain and can have an impact on performance

According to Julie Lermans course at Pluralsight.com it is possible (and recommended) to separate models (contexts) using Code-First approach, but how can I do it using Model-First approach? Is it possible?

Any suggestions?

Foi útil?

Solução

Why not do it in Code First? It's a better way and gives you more control (at least my opinion :)) I'm not familiar with Model first approach but you need to have possibility to:

  • Map your entities to same database table even if they have not the exact same name.
  • Being able to setup a MigrationContext that you can use for Migration, since none of the other bounded context's do not have the full schema (if your intent is to have all bounded context's in one physical database)

if your Model first approach can do this. I see no problem with doing that.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top