Code Monkey home page Code Monkey logo

gamestore-dotnet-core-rest-api's Introduction

๐Ÿš€ 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.