Skip to content

JordanDChappell/dotnet-minimal-api-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-minimal-api-examples

API examples built in .NET to be used as a supplement to an article on all things REST and HTTP web API.

Concepts

  • Consistent method naming
  • Consistent response structure
  • Utilise HTTP ations
  • Provide meaningful responses
  • Avoid side effects
  • Validate data
  • Implement versioning
  • Provide a specification

Versioning

Different API versions have been implemented to showcase good and bad practices for each concept.

Getting Started

Prerequisites

Running the application

VSCode

  • Open the root of the repository in VSCode
  • Navigate to the 'Run and Debug' menu (CTRL + SHIFT + D)
  • Ensure that 'Debug Application' is shown in the drop down to the right of the green 'Start Debugging' button
  • Click the 'Start Debugging' button (F5)

Terminal

  • Build the application
    • dotnet build ./Application/Application.csproj
  • Run the application
    • dotnet ./Application/bin/Debug/net7.0/Application.dll

Open API documentation

Navigate to http://localhost:5050/swagger (or whatever port the application is currently running on)

About

API best (and bad) practice examples using a .NET minimal API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages