CloudNative.CloudEvents.AspNetCore
2.9.0
dotnet add package CloudNative.CloudEvents.AspNetCore --version 2.9.0
NuGet\Install-Package CloudNative.CloudEvents.AspNetCore -Version 2.9.0
<PackageReference Include="CloudNative.CloudEvents.AspNetCore" Version="2.9.0" />
<PackageVersion Include="CloudNative.CloudEvents.AspNetCore" Version="2.9.0" />
<PackageReference Include="CloudNative.CloudEvents.AspNetCore" />
paket add CloudNative.CloudEvents.AspNetCore --version 2.9.0
#r "nuget: CloudNative.CloudEvents.AspNetCore, 2.9.0"
#:package CloudNative.CloudEvents.AspNetCore@2.9.0
#addin nuget:?package=CloudNative.CloudEvents.AspNetCore&version=2.9.0
#tool nuget:?package=CloudNative.CloudEvents.AspNetCore&version=2.9.0
About
This package provides a protocol binding for transporting CloudEvents with ASP.NET Core request and response types; for an overview of protocol bindings and their types in this SDK, see the Protocol bindings section of the user guide.
How to Use
Use this package with a formatter in an ASP.NET Core endpoint to read a CloudEvent from the request and write one to the response:
using CloudNative.CloudEvents;
using CloudNative.CloudEvents.AspNetCore;
using CloudNative.CloudEvents.SystemTextJson;
using Microsoft.AspNetCore.Http;
app.MapPost("/events", async (HttpRequest request, HttpResponse response) =>
{
var formatter = new JsonEventFormatter();
var cloudEvent = await request.ToCloudEventAsync(formatter);
var result = new CloudEvent
{
Id = Guid.NewGuid().ToString(),
Source = new Uri("https://example.com/processed"),
Type = "com.example.event.processed",
DataContentType = "application/json",
Data = new { OriginalId = cloudEvent.Id }
};
await result.CopyToHttpResponseAsync(response, ContentMode.Structured, formatter);
});
For more examples, see Samples.
Additional Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- CloudNative.CloudEvents (>= 2.9.0)
- Microsoft.AspNetCore.Http (>= 2.3.11)
- System.Text.Encodings.Web (>= 10.0.9)
-
net10.0
- CloudNative.CloudEvents (>= 2.9.0)
-
net8.0
- CloudNative.CloudEvents (>= 2.9.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CloudNative.CloudEvents.AspNetCore:
| Package | Downloads |
|---|---|
|
Google.Cloud.Functions.Framework
Google Cloud Functions Framework |
|
|
Weikio.EventFramework.AspNetCore
Event Framework with ASP.NET Core made easy. Event Framework is a CloudEvents router and gateway for .NET. |
|
|
Weikio.EventFramework.EventGateway.HTTP
HTTP Cloud Event Gateway for .NET. |
|
|
xSdk.Extensions.CloudEvents
xSdk.Extensions.CloudEvents - CloudEvents extensions for the xSdk project. |
|
|
OpenFunction.Framework
OpenFunction Framework |
GitHub repositories (5)
Showing the top 5 popular GitHub repositories that depend on CloudNative.CloudEvents.AspNetCore:
| Repository | Stars |
|---|---|
|
GoogleCloudPlatform/dotnet-docs-samples
.NET code samples used on https://cloud.google.com
|
|
|
erwinkramer/bank-api
The Bank API is a design reference project suitable to bootstrap development for a compliant and modern API.
|
|
|
meteatamel/knative-tutorial
A collection of samples for Knative Serving, Knative Eventing and Knative-GCP projects.
|
|
|
daohainam/microservice-patterns
Microservice pattern demos (Saga, EventSourcing, CQRS...) running on .NET Aspire
|
|
|
GoogleCloudPlatform/functions-framework-dotnet
FaaS (Function as a service) framework for writing portable .NET functions
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.9.0 | 1,529 | 7/4/2026 |
| 2.8.0 | 1,089,399 | 8/7/2024 |
| 2.7.1 | 906,867 | 9/4/2023 |
| 2.7.0 | 30,894 | 7/31/2023 |
| 2.6.0 | 465,665 | 3/7/2023 |
| 2.5.1 | 2,054,507 | 11/10/2022 |
| 2.5.0 | 1,991,704 | 10/17/2022 |
| 2.4.0 | 80,705 | 9/8/2022 |
| 2.3.1 | 58,262 | 6/29/2022 |
| 2.3.0 | 88,810 | 5/31/2022 |
| 2.2.0 | 158,409 | 2/2/2022 |
| 2.1.1 | 742,064 | 7/21/2021 |
| 2.1.0 | 11,438 | 7/14/2021 |
| 2.0.0 | 3,003,295 | 6/15/2021 |
| 2.0.0-rc.1 | 3,989 | 6/7/2021 |
| 2.0.0-beta.3 | 458 | 5/12/2021 |
| 2.0.0-beta.2 | 415 | 5/5/2021 |
| 2.0.0-beta.1 | 125,468 | 11/11/2020 |
| 1.3.80 | 3,993,444 | 1/16/2020 |
| 1.0.71 | 1,690 | 11/21/2019 |