-
Notifications
You must be signed in to change notification settings - Fork 0
Create
Miguel Bernard edited this page Jul 7, 2021
·
3 revisions
CloudEventBuilder
implements a builder pattern that allows gathering all the necessary information to build the cloud event at different times and then build the CloudEvent once ready. The CloudEventBuilder
also provides a default for all properties (except for Data
), which enables a simple construction by convention or with a global configuration.
// Simple
var ce = new CloudEventBuilder<UserCreated>(userCreated)
.Build();
// With some property
var ce2 = new CloudEventBuilder<UserCreated>(userCreated)
.WithSource("mySource")
.Build();