fadihania / MinimalApiRouting

A sample .NET 7 Minimal API app that shows the basics of using Routing. It shows how to use URL, Methods and Binding to handle request and offer a simple way to organize the project's code

Home Page:https://coddict.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimal API Routing

A sample .NET 7 Minimal API app that shows the basics of using Routing. It shows how to use URL, Methods and Binding to handle request and offer a simple way to organize the project's code. (It's missing validation and error handling)

Check commits for steps and how to apply different concepts

  • Routing (URL/Method)

  • Parameter binding:

    • Route (URL)
    • Body
    • Query
    • Services
    • Headers
  • Use C# attribute to specify binding:

    • [FromRoute]
    • [FromBody]
    • [FromQuery]
    • [FromServices]
    • [FromHeader]
  • Classes

    • Fields
    • Properties
    • Methods/lambda expressions
  • Value and reference types

  • Records

About

A sample .NET 7 Minimal API app that shows the basics of using Routing. It shows how to use URL, Methods and Binding to handle request and offer a simple way to organize the project's code

https://coddict.co

License:MIT License


Languages

Language:C# 100.0%