From the course: .NET Microservices for Azure Developers
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Implementing a new endpoint and memory cache - Azure Tutorial
From the course: .NET Microservices for Azure Developers
Challenge: Implementing a new endpoint and memory cache
(upbeat music) - [Instructor] Okay, it's time for another challenge. The goal is for you to get real hands on practice implementing in memory caching for your microservices. If you'd like to skip this, please join me in the next chapter. If you accept the challenge, you'll need to implement the following. First and foremost, you need to add a new endpoint for modifying a single Pet. You should be able to modify the name, age, and breed ID. Then you'll inject the IMemoryCache interface into the ClinicApplicationService class. The idea is to reduce the communication that happens between the clinic and management microservices. Of course, this is a simple solution, but it's quite convenient for this scenario. So we're going to store the last PetInfo object into the memory cache, and you can use any expiration strategy, but I suggest you use the AbsoluteExpirationRelativeToNow property and set it to 30 seconds. This will be enough time to test the behavior in Swagger or Postman. Finally…
Contents
-
-
-
-
-
-
-
(Locked)
Creating the Clinic microservice2m 44s
-
(Locked)
Adding the ClinicDbContext class3m 44s
-
(Locked)
Implementing the ManagementService class5m 41s
-
(Locked)
Implementing the ClinicApplicationService class6m 35s
-
(Locked)
Adding resilience traits to the microservice using Polly3m 20s
-
(Locked)
Creating the Container App for the Clinic microservice1m 2s
-
(Locked)
Creating the Dockerfile and modifying the workflow3m 17s
-
(Locked)
Adding environment variables to the Clinic microservice4m 41s
-
(Locked)
Challenge: Implementing a new endpoint and memory cache1m 30s
-
(Locked)
Solution: Implement a new endpoint and memory cache2m 41s
-
(Locked)
-