In CQRS, how do you build the response when creating an entity?
问题 If using CQRS and creating an entity, and the values of some of its properties are generated part of the its constructor (e.g. a default active value for the status property, or the current datetime for createdAt ), how do you include that as part of your response if your command handlers can’t return values? 回答1: You would need to create guid before creating an entity, then use this guid to query it. This way your command handlers always return void. [HttpPost] public ActionResult Add(string