title: How to Read and Write using CQS
body: <p>I'm going to start off a new project with CQS (as one aspect of its design), but NO CQRS + Event Sourcing, or Event Streaming, or Historical Modeling.  When I come across a situation in which I will have a large set of people using a small set of data (and do not want to block the user), I will implement Event Sourcing.    What this means (to me at least) is all I’m doing is starting out with a separation of the command from query (separation of concerns).</p>
  
  <p>I'm using EF ORM and the actual Schema for the command side.  On the query side it's best to use only views (from what I'm reading), but this opinion I think doesn't preclude me using an ORM (or not), and/or Repo, or ADO.NET + Stored Procedures, etc., as method for accessing these views from the DB (I think).  </p>
  
  <p>Here is a diagram I made to approximately-illustrate what I have in mind (its by no means comprehensive):</p>
  
  <p><img src="https://i.stack.imgur.com/mbyhl.png" alt="enter image description here"></p>
  
  <p>My question:</p>
  
  <p>Part 1: I don't know the -- right /best/easiest/most optimized/most maintainable/easiest to migrate to event sourcing at some point -- way (I realize this is subjective) to retrieve data from the database (from a View) and use ViewModels (DTOs) to supply the client a fresh view of some state (AFTER a call to the command side)?  </p>
  
  <p>Part 2: After I've made a change to the task based web UI, and therefore changed ViewModel that underlies the UI, how do I issue a Command from this when the ViewModel is completely separate from Entities (Domain Model) on the command side.  These ViewModels (DTOs) might be a completely different "shape" than the Entities.  </p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>To be clear, I'm not going to use Async and Transactions are a plus to start, this is only Command and Query Separation (not full blown CQRS, where the Command side returns "void" only) -- I'm looking for the very basics here.  Also, from what I've read so far, it seems DDD and the Bounded Context go hand in hand with CQRS, at this point I have no real experience with DDD or Aggregate Root along with the Bounded Context and so far have not seen a real and pressing need to engage with this methodology/pattern.  At this moment it seems I will be using EF/Migrations for the Command side, and have not decided what to use on the Query side (ADO.NET is being considered).  </p>
  
  <p>The Command side in my case will return an object, for example a new Customer with a database generated CustomerId.  I will use one database for both Commands and Queries, and would like to use Views build in the DB for as return Models from the Queries (in other words, I would like the Queries to be "mapped" to Views for the most part).  What I don't know is how the Command should look in cases where and object should be returned, if I'm to use the Query side to return data for the Command side.  I'll try to incorporate Automapper to convert the objects to ViewModels in the case of MVC.</p>