Samples for ASP.NET Core 6.0 (448)
Samples for ASP.NET Core 7.0 is available here (45).
|Blazor Client Side (Web Assembly)||22||Components, Data Binding|
|Blazor Server Side||15||Localization|
|gRPC (including grpc-Web)||12|
|Localization and Globalization||6|
|Minimal API||36||Routing, Parameter Bindings, etc|
|MVC||47||Localization, Routing, Razor Class Library, Tag Helpers, View Component, etc|
|Path String (HttpContext.Request.Path)||1|
|Request||15||Form, Cookies, Query String, Headers|
|Single File Application||2|
|Static Files and File Provider||10|
How to run these samples
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.
Keep track of anonymous user in your ASP.NET Core (useful in scenario such as keeping track of shopping cart) using
Give it a string and it will generate a secure hash for you, e.g.
Show various version info of the framework your system is running on.
Responds to application startup and shutdown.
We are using
IApplicationLifetimethat trigger events during application startup and shutdown.
Server-Sent Events (1)
This server will send a 'hello world' greeting forever.
Serve markdown file as html file. You will see how you can create useful app using a few basic facilities in aspnetcore.
Serve markdown file as html file. It has the same exact functionality as Markdown server but implemented using middleware component.
Here we contrast between the usage of
This class provides convenient constants for some common MIME types. It's not extensive by any means however
FileExtensionContentTypeProviderto obtain the correct MIME type of a filename extension.
Device Detection (1)
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.
Image Sharp (1)
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.