- Fundamentals. Lambdas. Flat Structure file
- Architecturing MinimalAPI. Reflection & Class registration
- CORS for MinimalAPI
- IOptions, Configuration, IOptionMonitor, IOptionSnapshot, IOptionFactory
- Exception Handling following IETF Standard and custom handling
- Logging
- DTO Fluent Validation. Enrich Swagger with Validation Rules Description
- Automapper
- Dapper & Automapper
- Authentication using JWT
- Authorization using different methods
- Localization & Globalization using resx. DateTime Converter
- Benchmakring ControllerAPI & MinimalAPI
- Error handling, RFC 9547 Modern standard and outdated RFC 7807
Examples:
Examples:
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:
- cmd -> dotnet install -g --version 1.1.0 LiveReloadServer
- cmd -> dontnet install -g LiveReloadServer
To host Index.Html file in server's memory:
- cmd -> livereloadserver {BasePath}\Chapter03-CORS-GlobalAPISettings\Folder-For-Frontend
Examples:
RFC 9457 Doc:
Media Type: application/problem+json
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
Content-Language: en
{
"type": "https://example.net/validation-error",
"title": "Your request is not valid.",
"errors": [
{
"detail": "must be a positive integer",
"pointer": "#/age"
},
{
"detail": "must be 'green', 'red' or 'blue'",
"pointer": "#/profile/color"
}
]
}
{
"type": "Bad Request",
"title": "Something went wrong with OpenWeather Service",
"status": 400,
"detail": "Response status code does not indicate success: 401 (Unauthorized).",
"instance": "GET /get-weather",
"requestId": "0HN8TPG6GMH5R:00000007",
"traceId": "00-352bd6ae37ee396964f8a999d6762418-ffde06642c1bdaf4-00"
}
Examples:
RFC 7807 (OBSOLETE) And Documentation:
Media Type: application/problem+json
Proposed Format:
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
Content-Language: en
{
"type": "https://example.com/probs/out-of-credit",
"title": "You do not have enough credit.",
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc",
"balance": 30,
"accounts": ["/account/12345",
"/account/67890"]
}
Examples:
Examples:
Examples:
http_req: 20078 - means a number of requests handled per second and total number of them