Skip to content

Glareone/Minimal-API-Controllerless-Fluent-Net6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Minimal-API-.Net6

Table of content, projects with detailed examples

  1. Fundamentals. Lambdas. Flat Structure file
  2. Architecturing MinimalAPI. Reflection & Class registration
  3. CORS for MinimalAPI
  4. IOptions, Configuration, IOptionMonitor, IOptionSnapshot, IOptionFactory
  5. Exception Handling following IETF Standard and custom handling
  6. Logging
  7. DTO Fluent Validation. Enrich Swagger with Validation Rules Description
  8. Automapper
  9. Dapper & Automapper
  10. Authentication using JWT
  11. Authorization using different methods
  12. Localization & Globalization using resx. DateTime Converter
  13. Benchmakring ControllerAPI & MinimalAPI

Minimal API .Net6. General Information

Examples:

image
image

CORS

Examples:

image
image

Run FrontendSPA to test CORS

In order to test CORS you may run Index.html file hosted under Course03 project in Frontend-for-CORS folder using LiveReloadServer

To Install LiveReloadServer for .Net6 and .Net7:

  1. cmd -> dotnet install -g --version 1.1.0 LiveReloadServer
  2. cmd -> dontnet install -g LiveReloadServer

To host Index.Html file in server's memory:

  1. cmd -> livereloadserver {BasePath}\Chapter03-CORS-GlobalAPISettings\Folder-For-Frontend

IOptions vs IOptionMonitor vs IOptionSnapshot

Examples:

image

Error handling using IETF Standard

Examples:

image

Configuring Logging in .Net6 MinimalAPI

Examples:

image
image

Fluent Validation

Examples:

image

Benchmarking using K6

http_req: 20078 - means a number of requests handled per second and total number of them
image

Compare Controllers vs MinimalAPI

image

The difference is approximately 5-20%.
image
results
minimalapi-text-plain
controllerapi-text-plain