vendredi 23 juin 2017

EF an cqrs: editing and entity while both keeping separation of layers and of query and command

I am changing a crud nTier web app(MVC) to a cqrs implementation (this is my first time doing this) and i'm now splitting what was the business layer. I'm having trouble rewriting some commands that edit entities this is due to the fact that I would have to run a query to get the entity in order Edit it. I think the correct thing to do would this would be to get the controller to run a query and then pass the entity down but this seems to brake the separation between tiers as it would mean the presentation layer would know about the Data access. What do I do here, is there a way in EF to edit an entity using a new version of the model used to create the entity. If that is not possible how can I do this without breaking separation of concerns or cqrs.

Some options i have considered are

  • Pulling my models out into a common library

  • Doing a query in the command stack but still returning nothing

Aucun commentaire:

Enregistrer un commentaire