Samples in this section require .NET 7. You can download it from here.
-
Infer dependency from action parameter
There is no need for
[FromServices]
attribute anymore to inject a dependency to your action method. -
Microsoft.AspNetCore.Http.TypedResults
static class is the “typed” equivalent of the existingMicrosoft.AspNetCore.Http.Results
class. -
This sample demonstrate the usage of
WithOpenApi
extension method available inMicrosoft.AspNetCore.OpenApi
to customize OpenAPI operation information. -
Results<TResult1, TResult2, TResultN>
provides better description of the result of the operation that OpenAPI/Swagger can use in describing the API. -
This sample demonstrates the usage of
IFormFile
to upload a file in Minimal API. -
This sample demonstrates the usage of
IFormFileCollection
to upload multiple files in Minimal API.
-
This sample shows how to apply an Endpoint filter to your minimal API.
-
This sample shows how to apply multiple Endpoint filters to your minimal APIs.
-
This examples shows the sequence of code execution before
RouteHandlerFilterDelegate
and afterRouteHandlerFilterDelegate
in multiple endpoint filters. -
Use
IStatusCodeHttpResult
to detect return result in filter.
-
MapGroup()
extension methods allow grouping of endpoints with a common prefix. It also allow group metadata to be attached to the group. -
Use
.WithTags()
,.WithDescription()
,.WithSummary()
to enrich OpenAPI information for all the endpoints in the group. -
Use
.ExcludeFromDescription
to exclude endpoints from OpenAPI description.
-
This sample shows the usage of the simplified authentication and authorization via
builder.AddAuthentication().AddJwtBearer();
. -
This sample shows the usage of the simplified authentication and authorization via
builder.AddAuthentication().AddCookie();
. -
This sample shows how to use both JWT and Cookie authentications in the same application.
-
This sample shows how to use the
OutputCache
middleware using basic options. -
This sample shows how to use the
OutputCache
middleware and vary them by one or more query string. -
This sample shows how to tagged cache items and evict them by tag using
IOutputCacheStore.EvictByTagAsync
. -
Output Cache - 4 This sample shows how to enable output cache for every single endpoint.
-
Output Cache - 5 This sample shows how to setup a global Output Cache policy to cache any request with "cache" query string parameter.
-
Output Cache - 6 This sample demonstrates on how to setup a global Output Cache policy to cache any request that start with "/cache" in the url segments.
-
Output Cache - 7 This sample demonstrates on how to setup a cache policy and use it. Specific policy override the global base policy.
-
Output Cache - 8 This sample demonstrates on how to setup a cache policy that set an expiration time of 10 minutes.
-
This sample shows how to make a GET HTTP call to a gRPC endpoint via gRPC JSON transcoding.
-
This sample shows how to make a POST HTTP call to a gRPC endpoint via gRPC JSON transcoding.
-
This sample shows how to make a POST HTTP call to a gRPC endpoint via gRPC JSON transcoding by combining route parameter and body.
-
This sample shows how to make a PUT HTTP call to a gRPC endpoint via gRPC JSON transcoding.
-
This sample shows how to make a PATCH HTTP call to a gRPC endpoint via gRPC JSON transcoding.
-
This sample demonstrates @bind:after modifier that allows to execute async code after a binding event has been completed (value has changed).
-
This sample demonstrates @bind:get @bind:set modifier that simplify two-way data binding.
-
This sample shows how to implement a HTML custom element using Blazor Web Assembly.
-
This sample shows how set and get a property of a HTML custom element implemented using Blazor Web Assembly.
-
This sample shows how to raise an event from HTML custom element implemented using Blazor Web Assembly.
-
This sample shows how to enable returning Problem Details in unhandled exception responses.
-
This example shows how customize returned Problem Details in unhandled exception responses.
-
This example shows how customize Problem Details by manipulating
IProblemDetailsService
.
-
Show how to customize serialization using
DefaultJsonTypeInfoResolver
. -
Customize serialization by writing
number
asstring
in JSON forAge
values. -
In this case we add one extra
timestamp
property to the serialization process.
-
This sample shows how to use Orleans 7 in a minimal API application. It shows the new way on how to configure an Orleans server.
-
This is a sample project that shows how to use Redis as a persistence provider for Orleans.
-
This sample demonstrates the functionality of Orleans' Timer via Grain.RegisterTimer. It's useful to trigger actions to be repeated frequently (less than every minute).
-
This sample demonstrates the functionality of Orleans' Reminder via Grain.RegisterOrUpdateReminder. It's useful to trigger actions to be repeated infrequently (more than every minute, hours or days). This is a persistent timer that survives grain restarts. Reminder is much expensive than Timer.
-
This sample demonstrates using HttpClient in a
grain
and also introduces the concept of a Stateless Workergrain
.