README.md
Greetings from Cairo, Egypt. You can sponsor this project here.
You can find samples on new features available in ASP.NET Core 10(12) here. Datastar examples (20) can be found here.
You can find samples on new features available in ASP.NET Core 9(3) here.
To run these samples, simply open your command line console, go to each folder and execute dotnet watch run.
This sample shows how to obtain application environment information (target framework, etc).
Enumerate the connection information of a HTTP request.
Give it a string and it will generate a secure hash for you, e.g. localhost:5000?password=mypassword.
Show various version info of the framework your system is running on.
Responds to application startup and shutdown.
We are using IApplicationLifetime that trigger events during application startup and shutdown.
Use MapShortCircuit or .ShortCircuit() to efficiently respond to a request without going through a middleware pipeline run.
This server will send a 'hello world' greeting forever using .NET 10 built-in SSE support.
Serve markdown file as html file. You will see how you can create useful app using a few basic facilities in aspnetcore.
We take "Markdig" as dependency.
Markdown server - implemented as middleware component
Serve markdown file as html file. It has the same exact functionality as Markdown server but implemented using middleware component.
We take "Markdig" as dependency.
Here we contrast between the usage of Microsoft.AspNetCore.Http.StatusCodes and System.Net.HttpStatusCode.
This class provides convenient constants for some common MIME types. It's not extensive by any means however MediaTypeNames.Text.Html and MediaTypeNames.Application.Json come handy.
Using FileExtensionContentTypeProvider to obtain the correct MIME type of a filename extension.
The samples in this section rely on Wangkanai.Detection library.
This is the most basic device detection. You will be able to detect whether the client is a desktop or a mobile client.
All these samples require SixLabors.ImageSharp.Web middleware package. This middleware is an excelent tool to process your day to day image processing need.
This example shows how to enable image resizing functionality to your site. It's super easy and the middleware takes care of caching, etc.