Last week, I had the opportunity to learn the architecture of ASP.NET Core 3. The first part of the course I was exposed to the importance of separating concerns in an application by organizing code into layers, including the presentation layer, application layer, domain layer, and infrastructure layer. Additionally, I also explored how to implement clean architecture in ASP.NET Core 3 applications, including how to structure the code and how to use interfaces and dependency injection to decouple components so that the code easier to maintain for future usage.
Going to the next part, I started to delved into Automapper, a powerful tool that can simplify the process of mapping data between different objects in the application. I learned how to install and configure Automapper in ASP.NET Core 3 application, and how to use it to map data between entities and DTOs (data transfer objects). Next, a design pattern known as CQRS (Command Query Responsibility Segregation), which divides the duties of managing read and write operations in an application, was the next area of emphasis for me. At first, I struggled to understand the CQRS concept, but Mr. Peter clarified it for me, helping me to understand the idea of it as a whole. I learned about the benefits of CQRS, including how it improved scalability and performance. I even also explored how to use MediatR, a popular library for implementing CQRS in .NET applications.
After few days going through the architecture of ASP.NET, the next 2 and a half day of the week I started to go through a new topic called “Building a RESTful API with ASP.NET Core 3”. I learned about the difference between the Outer Facing Model and the Entity Model. The Outer Facing Model represents the data that will be exposed to clients through the API, while the Entity Model represents the data that is stored in the database. the course also taught on how to map between these two models, and how to use Automapper to simplify the process.
Another key aspect of building a RESTful API is handling HTTP requests, including POST, PUT, and PATCH requests. I learned the differences between these requests and how to handle them in an API. I also explored how to use data annotations and custom validators to validate user input, which is critical for ensuring the integrity of data. Finally, the course covered how to delete a resource in an API, including how to handle deleting a single and related resources in the database.
Overall, the past week learning is quite complex for me. I did gained the understanding of the whole concept and idea of the materials but in term of practicality and codes, I must say I’m still very weak. However, I really look forward on exploring more on these topics and gaining deeper understanding on implementing the knowledge of the ASP.NET architecture and building the RESTful API.
