This is more of a design question so apologies if this is in the wrong place. That said, I am designing an application which comprises of a WPF user interface with a WCF service layer that provides access to the application data and business logic. I have several scenarios where CQRS and ES are required which is where my question comes from.
CQRS is about Command and Query separation, so the question I have is should my WCF service also be separated so I have the Command methods in one service and the Query methods in another. For example:
public class PatientCommandService
{
public void AddPatient(AddPatientDto patient) { }
}
public class PatientQueryService
{
public PatientDto GetById(int id) { }
}
I am new to CQRS and ES and have struggled to find anything tangible on the internet that would answer this question, particularly around web services such as WCF and WebAPI.
It seem sensible to have all service methods within the same service and separate the Command and Query through a repository layer in the implementation of each service method. But that seems to defy the separation part of CQRS and I am also conflicted with SOLID principles around Single Responsibility.
Has anyone implemented CQRS behind a WCF service and dealt with this scenario, I am seeking some advice really about the best approach for implementing CQRS.