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.

Solution: Implementing event sourcing

Solution: Implementing event sourcing

(upbeat music) - [Instructor] Okay, let's see how we can solve this challenge. The first thing that I want to do is to create the Azure function. So, let's name it WisdomPetMedicine.Hospital.Projector and we're going to put the code inside the source folder. Here, we're going to use the Cosmos DB Trigger because that's exactly what's going to happen. We're going to connect to the change feed of Azure Cosmos DB. Here, I'm using .net5 isolated because that's the latest version of Azure functions at the time of this recording. For the connection string setting name, I'm going to use cosmos DB connection string, and for the database name, as you might recall, is wisdom pet medicine, and the collection name is patients. Now, we need to add a reference to both domain and infrastructure, and also we need additional new git packages here. So to accelerate this process, I have the code already, and I'm going to paste it. As…

Contents