Parrurox / GAMESTORE-Dotnet-Core-REST-API

practice project with .NET core framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐Ÿš€ Exciting Journey in .NET Development! ๐ŸŽฎ

๐Ÿ“š I recently added the miniapis.extension package from the NuGet Gallery to my web API project. This package provides convenient input validation for my application.

๐Ÿ”ง To start, I created a new web API project using the dotnet new web command. With the help of dotnet watch run, I can now hot reload the server and quickly see the changes by pressing ctrl + r.

๐Ÿ” To organize my code, I added an endpoints folder and created classes for each endpoint. This allowed me to refactor my program.cs file and use the app.<endpoint_class_method>() syntax for cleaner code.

๐Ÿ“ฆ I also created a repositories folder to store my game list, making it read-only. This separation of concerns improved the maintainability of my project.

๐Ÿ”ง I implemented CRUD operations by defining new methods and made the game list private instead of static. This enhanced the encapsulation of my code.

๐ŸŒŸ Understanding service lifetimes, I introduced an interface called IGamesRepository and moved it to a separate file. Now, I pass the IGamesRepository type as an argument in my endpoints instead of creating an instance at the top.

๐Ÿ”Œ Finally, I registered my instance in the program.cs file to ensure proper dependency injection.

Join me on this amazing journey in .NET development! Let's build robust and scalable applications together. ๐Ÿš€๐Ÿ’ป

#dotnet #webdevelopment #dotnetcore #journey

About

practice project with .NET core framework


Languages

Language:C# 100.0%