- Notifications
You must be signed in to change notification settings - Fork0
Practical samples of ASP.NET Core 2.1, 2.2, 3.1, 5.0, 6.0, 7.0 and 8.0 preview 2 projects you can use. Readme contains explanations on all projects.
License
Pro-Coded-External/practical-aspnetcore
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
- Samples for new features of ASP.NET Core8.0 are availablehere (42).
- Samples for new features of ASP.NET Core7.0 are availablehere (45).
Greetings from Cairo, Egypt. You cansponsor this projecthere.
| Section | ||
|---|---|---|
| Blazor Client Side (Web Assembly) | 22 | Components, Data Binding |
| Blazor Server Side | 15 | Localization |
| Caching | 5 | |
| Configurations | 10 | |
| CoreWCF | 1 | |
| Dependency Injection | 4 | |
| Diagnostics | 6 | |
| Endpoint Routing | 32 | |
| 2 | ||
| Elsa Workflow | 14 | |
| Features | 11 | |
| Generic Hosting | 9 | |
| gRPC (including grpc-Web) | 12 | |
| Health Check | 6 | |
| IHttpClientFactory | 4 | |
| IHostedService | 2 | |
| Logging | 4 | |
| Localization and Globalization | 6 | |
| Middleware | 14 | |
| Mini Apps | 2 | |
| Minimal API | 36 | Routing, Parameter Bindings, etc |
| Minimal Hosting | 23 | |
| MVC | 47 | Localization, Routing, Razor Class Library, Tag Helpers, View Component, etc |
| Open Telemetry | 3 | |
| Orchard Core | 4 | |
| Path String (HttpContext.Request.Path) | 1 | |
| Razor Pages | 10 | TempData |
| Request | 15 | Form, Cookies, Query String, Headers |
| Response | 3 | |
| SignalR | 1 | |
| Security | 7 | |
| Single File Application | 2 | |
| Static Files and File Provider | 10 | |
| System.Text.Json | 22 | |
| Syndications | 3 | |
| Testing | 1 | |
| URL Redirect/Rewrite | 6 | |
| Uri Helper | 5 | |
| Windows Service | 1 | |
| Web Sockets | 6 | |
| Web Utilities | 3 | |
| Orleans | 12 | |
| Xml | 1 | |
| YARP | 1 |
For Data Access samples, go to the excellentORM Cookbook. .NET team also hasa sample repository.
To run these samples, simply open your command line console, go to each folder and executedotnet watch run.
This sample shows how to obtain application environment information (target framework, etc).
Enumerate the connection information of a HTTP request.
Keeping track of anonymous users
Keep track of anonymous user in your ASP.NET Core (useful in scenario such as keeping track of shopping cart) using
ReturnTrue.AspNetCore.Identity.Anonymouslibrary.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
IApplicationLifetimethat trigger events during application startup and shutdown.
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.
We take
"Markdig"as dependency.Markdown server - implemented as middleware component
Serve markdown file as html file. It has the same exact functionality asMarkdown server but implemented using middleware component.
We take
"Markdig"as dependency.
Here we contrast between the usage of
Microsoft.AspNetCore.Http.StatusCodesandSystem.Net.HttpStatusCode.This class provides convenient constants for some common MIME types. It's not extensive by any means however
MediaTypeNames.Text.HtmlandMediaTypeNames.Application.Jsoncome handy.Using
FileExtensionContentTypeProviderto obtain the correct MIME type of a filename extension.
The samples in this section rely onWangkanai.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 requireSixLabors.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.
About
Practical samples of ASP.NET Core 2.1, 2.2, 3.1, 5.0, 6.0, 7.0 and 8.0 preview 2 projects you can use. Readme contains explanations on all projects.
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- C#72.5%
- HTML23.1%
- Batchfile4.3%
- Dockerfile0.1%