Skip to content
Miguel Bernard edited this page Jul 7, 2021 · 3 revisions

Constructor

Builder

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.

Usage

// Simple
var ce = new CloudEventBuilder<UserCreated>(userCreated)
             .Build();

// With some property
var ce2 = new CloudEventBuilder<UserCreated>(userCreated)
              .WithSource("mySource")
              .Build();
Clone this wiki locally