From the course: .NET Microservices for Azure Developers

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Implementing the ClinicApplicationService class

Implementing the ClinicApplicationService class - Azure Tutorial

From the course: .NET Microservices for Azure Developers

Implementing the ClinicApplicationService class

- [Instructor] I could inject both the management service and the ClinicDbContext directly into the consultation controller class. However, to maintain a clean and organized controller, we'll create a new class named clinic application service instead. So first, let's create a new folder, and let's name it Application. And the class is going to be ClinicApplicationService. So here, I want to inject ClinicDbContext and the managementService objects. So now, let's use the file scope namespace syntax, of course, and let's implement a new method for handling the start consultation command. So let's do the following, public async and Handle. And this is going to handle the StartConsultationCommand. And this is going to return a new consultation object just to keep it simple, and let's do the following. So I know for sure that the managementService is going to return a new PetInfo object. So I'm going to pass command.Id, in other words, a patient ID. And of course, I need to await for this.…

Contents