Coder Social home page Coder Social logo

glareone / minimal-api-.net6 Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 271 KB

Minimal API .Net6

License: MIT License

C# 89.38% HTML 2.25% JavaScript 8.37%
minimal-api net-6 net-6-minapi-crud-project net-7 appinsights automapper cors dapper exception-handling fluentvalidation

minimal-api-.net6's Introduction

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

minimal-api-.net6's People

Contributors

glareone avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.