Skip to content

Commit 39a42f2

Browse files
author
Miguel Bernard
committed
readme
1 parent 076a760 commit 39a42f2

File tree

4 files changed

+94
-3
lines changed

4 files changed

+94
-3
lines changed

.vscode/launch.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
// Use IntelliSense to find out which attributes exist for C# debugging
6+
// Use hover for the description of the existing attributes
7+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/src/MBernard.CloudEvents.StronglyTyped.Tests.Unit/bin/Debug/net5.0/MBernard.CloudEvents.StronglyTyped.Tests.Unit.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}/src/MBernard.CloudEvents.StronglyTyped.Tests.Unit",
16+
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17+
"console": "internalConsole",
18+
"stopAtEntry": false
19+
},
20+
{
21+
"name": ".NET Core Attach",
22+
"type": "coreclr",
23+
"request": "attach"
24+
}
25+
]
26+
}

.vscode/tasks.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/src/MBernard.CloudEvents.StronglyTyped.Tests.Unit/MBernard.CloudEvents.StronglyTyped.Tests.Unit.csproj",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/src/MBernard.CloudEvents.StronglyTyped.Tests.Unit/MBernard.CloudEvents.StronglyTyped.Tests.Unit.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"${workspaceFolder}/src/MBernard.CloudEvents.StronglyTyped.Tests.Unit/MBernard.CloudEvents.StronglyTyped.Tests.Unit.csproj",
36+
"/property:GenerateFullPaths=true",
37+
"/consoleloggerparameters:NoSummary"
38+
],
39+
"problemMatcher": "$msCompile"
40+
}
41+
]
42+
}

README.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1-
# CloudEvents.Typed
1+
# CloudEvents. Typed
22

33
[![CI](https://github.com/mbernard/CloudEvents.Typed/actions/workflows/ci.yml/badge.svg)](https://github.com/mbernard/CloudEvents.Typed/actions/workflows/ci.yml)
44
[![CodeQL](https://github.com/mbernard/CloudEvents.StronglyTyped/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/mbernard/CloudEvents.StronglyTyped/actions/workflows/codeql-analysis.yml)
5-
[![Publish NuGet](https://github.com/mbernard/CloudEvents.StronglyTyped/actions/workflows/Publish.yml/badge.svg)](https://github.com/mbernard/CloudEvents.StronglyTyped/actions/workflows/Publish.yml)
5+
[![Publish NuGet](https://github.com/mbernard/CloudEvents.StronglyTyped/actions/workflows/Publish.yml/badge.svg)](https://github.com/mbernard/CloudEvents.StronglyTyped/actions/workflows/Publish.yml)
6+
7+
`CloudEvents. StronglyTyped` is an opinionated library that removes some friction of the `CloudNative.CloudEvents` C# SDK by providing a strongly typed implementation of the `CloudEvent<T>` class.
8+
The library also provides multiple utils to manipulate, transform and create CloudEvents.
9+
10+
# Goals
11+
* Conventions over configuration
12+
* Provide good default, but make everything extensible
13+
* More userfriendly to use than the default C# SDK
14+
* Type safety to avoid run-time errors
15+
* Avoid confusion regarding the content of the Data property of a CloudEvent
16+
* Modern design using C# 9 records
17+
* Structural equality
18+
* Intended to be used and passed around in your application business domain layer (carries all the metadata you need without the serialization information)
19+
* Very opinionated
20+
# In a nutshell
21+
22+
## TODO image here
23+
24+
# Design choices
25+
26+
## `dataContentType` and `dataSchema` are not present on the CloudEvent<T> object
27+
28+
`CloudEvent<T>` is considered a deserialized version of your cloud event; thus, those properties are no longer required as the `Data` property represents an in-memory object. If the event needs to be re-serialized, those values should be included on the non-generic CloudEvent before serializing with the formatter.

src/MBernard.CloudEvents.StronglyTyped.Tests.Unit/Data/UserCreatedRecordDataContract.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace MBernard.CloudEvents.StronglyTyped.Tests.Unit.Data
55
{
6-
[DataContract(Namespace = "https://miguelbernard.com/cloudevent.typed", Name = "user.created.v1")]
6+
[DataContract(Namespace = "https://miguelbernard.com/cloudevent.stronglytyped", Name = "user.created.v1")]
77
public record UserCreatedRecordDataContract
88
{
99
[DataMember]

0 commit comments

Comments
 (0)