-
-
Save vkhorikov/02778357c8f13e28c53320008d8687e1 to your computer and use it in GitHub Desktop.
Are CQRS commands part of the domain model?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IActionResult EditPersonalInfo([FromBody] EditPersonalInfoCommand command) | |
{ | |
var handler = new EditPersonalInfoCommandHandler(_unitOfWork); | |
Result result = handler.Handle(command); | |
return result.IsSuccess ? Ok() : Error(result.Error); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IActionResult EditPersonalInfo([FromBody] StudentPersonalInfoDto dto) | |
{ | |
var command = new EditPersonalInfoCommand | |
{ | |
Email = dto.Email, Name = dto.Name, Id = id | |
}; | |
var handler = new EditPersonalInfoCommandHandler(_unitOfWork); | |
Result result = handler.Handle(command); | |
return result.IsSuccess ? Ok() : Error(result.Error); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment