From the course: Advanced Azure Microservices with .NET for Developers
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Implementing the first command - Azure Tutorial
From the course: Advanced Azure Microservices with .NET for Developers
Implementing the first command
- [Instructor] In this video, we'll deal with the command part of the CQRS pattern. First, we'll add a new value object named AdopterPhoneNumber. Then we're going to create a new property in the adopter entity named phone number of type AdopterPhoneNumber. Since we don't want to allow external domain models or systems to modify the state of an entity object directly, we're going to expose a public method named SetPhoneNumber. In addition to that, we're going to modify the state validation logic of the adopter entity to prevent invalid phone numbers, at least in terms of a string length. Next we'll create a new class named SetAdopterPhoneNumber command in the Rescue API project. After that we'll modify the AdopterApplicationService class to add a new method for handling the SetAdopterPhoneNumber command. The AdopterController will initially receive the command as part of the HTTP request, which in turn uses the newer…