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

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