Thinking of abstracting once again how you build definitions, merging both definition builders into one. The library should be focused on what definitions can do, and not on what they should be. This way it should be simpler as you only care about what exactly they provide to you. This change would result in the following behaviour:
The builder is by default a builder for events.
If the builder uses the SetReturn method, it'll become a builder for functions.
If the Async method is used right after SetReturn, it'll become a builder for asynchronous functions.
Thinking of abstracting once again how you build definitions, merging both definition builders into one. The library should be focused on what definitions can do, and not on what they should be. This way it should be simpler as you only care about what exactly they provide to you. This change would result in the following behaviour:
SetReturn
method, it'll become a builder for functions.Async
method is used right afterSetReturn
, it'll become a builder for asynchronous functions.Change:
EventBuilder
&FunctionBuilder
->DefinitionBuilder
Regarding to #2, MessagingEventBuilder would need to receive a new name, which would likely be
GlobalDefinitionBuilder
.This should be elaborated later in the description.