Skip to content

Practical samples of ASP.NET Core 10 Preview 3, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.

License

Notifications You must be signed in to change notification settings

dodyg/practical-aspnetcore

Repository files navigation

Samples for ASP.NET Core 8.0

Note

This repository is WIP. I am updating all the previous samples from .NET 6/7 to .NET 8. Check the previous stable branch (6.0) if you want to browse the existing stable samples that contains also .NET 7/8 samples.

Greetings from Cairo, Egypt. You can sponsor this project here.

ASP.NET Core 10

You can find samples on new features availabel in ASP.NET Core 10 Preview 3(8) here.

ASP.NET Core 9

You can find samples on new features availabel in ASP.NET Core 9(3) here.

Previous versions

6.0, 5.0, 3.1 LTS, 2.1 LTS

Other Samples

Sections

Section
Authentication5
Blazor Client Side (Web Assembly)22.NET8 (WIP), Components, Data Binding
Blazor Server16Localization
Blazor Server Side Render22
Caching5
Configurations10
CoreWCF1
Dependency Injection4
Diagnostics5
Endpoint Routing32
Email2
Elsa Workflow14.NET8
Exception Handler Middleware2
Features11
Generic Hosting9
gRPC (including grpc-Web)12
Health Check6
HTMX40
IHttpClientFactory4
IHostedService2
Logging6
Localization and Globalization6
Middleware14
Mini Apps2
Minimal API36Routing, Parameter Bindings, etc
Minimal Hosting23
MVC47Localization, Routing, Razor Class Library, Tag Helpers, View Component, etc
Output Cache Middleware
Open Telemetry3
Orchard Core4
Path String (HttpContext.Request.Path)1
Polly1
Problem Details Middleware3
Razor Pages10TempData
RazorSlices1
Request15Form, Cookies, Query String, Headers
Request Timeouts Middleware6
Response3
SignalR1
Security7
Single File Application2
Static Files and File Provider10
System.Text.Json23
Syndications3
Testing1
Unpoly5
URL Redirect/Rewrite6
Uri Helper5
Windows Service1
Web Sockets6
Web Utilities3
Orleans5.NET.8
Xml1
YARP1

How to run these samples

To run these samples, simply open your command line console, go to each folder and execute dotnet watch run.

Misc (6)

  • Application Environment

    This sample shows how to obtain application environment information (target framework, etc).

  • Show Connection info

    Enumerate the connection information of a HTTP request.

  • Password Hasher server

    Give it a string and it will generate a secure hash for you, e.g. localhost:5000?password=mypassword.

  • Version info

    Show various version info of the framework your system is running on.

  • IApplicationLifetime

    Responds to application startup and shutdown.

    We are using IApplicationLifetime that trigger events during application startup and shutdown.

  • Short Circuit

    Use MapShortCircuit or .ShortCircuit() to efficiently respond to a request without going through a middleware pipeline run.

Server-Sent Events (1)

Markdown (2)

Utils (3)

  • Status Codes

    Here we contrast between the usage of Microsoft.AspNetCore.Http.StatusCodes and System.Net.HttpStatusCode.

  • MediaTypeNames

    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.

  • MediaTypeNames - 2

    Using FileExtensionContentTypeProvider to obtain the correct MIME type of a filename extension.

Device Detection (1)

The samples in this section rely on Wangkanai.Detection library.

  • Device Detection

    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.

  • Image-Sharp

    This example shows how to enable image resizing functionality to your site. It's super easy and the middleware takes care of caching, etc.

Misc

About

Practical samples of ASP.NET Core 10 Preview 3, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 
close