-
Notifications
You must be signed in to change notification settings - Fork 3
Naming
Oleg Karasik edited this page Dec 4, 2019
·
7 revisions
All builders in CoherentSolutions.Extensions.Hosting.ServiceFabric project follows the same naming convention. This convention defines both naming standards and execution expectations.
This family of methods is used to set values used by builders. All subsequent calls override previously set value.
// Example: Set IWebHostBuilder factory function to use when configuring IWebHost.
...
.DefineAspNetCoreListener(
listenerBuilder =>
{
listenerBuilder
.UseWebHostBuilder(() => { ... }) // <-- this value is overriden by next call.
.UseWebHostBuilder(() => { ... })
});
...
This family of methods is used to add configuration action to builder's pipeline. All calls do stack.
// Example: Configure two actions to be executed during IWebHost configuration.
...
.DefineAspNetCoreListener(
listenerBuilder =>
{
listenerBuilder
.ConfigureWebHost(builder => { ... }) // <-- this action will be called first
.ConfigureWebHost(builder => { ... }) // <-- this action will be called second
});
// The equivalent configuration can be achieved using single call to ConfigureWebHost.
.DefineAspNetCoreListener(
listenerBuilder =>
{
listenerBuilder
.ConfigureWebHost(
builder =>
{
... // <-- the first block of code
... // <-- the second block of code
})
});
...
This family of methods is used to configure builder's components. All subsequent calls override previous configuration.
// Example: Reconfiguring event source component.
...
new HostBuilder()
.DefineStatefulService(
serviceBuilder =>
{
serviceBuilder.SetupEventSource(eventSourceBuilder => { ... })
})
.Build()
.Run();
...
This family of methods is used to create new building blocks. Every call creates new building block.
// Example: Configure two ASP.NET Core listeners
...
new HostBuilder()
.DefineStatelessServiceHost(
serviceBuilder =>
{
serviceBuilder
.DefineAspNetCoreListener( // <-- Create a new listener for 'endpoint1'
listenerBuilder => { ... })
.DefineAspNetCoreListener( // <-- Create a new listener for 'endpoint2'
listenerBuilder => { ... });
})
...
(c) 2021 Coherent Solutions Inc.
GENERAL
GETTING STARTED
UNDERSTANDING THE PROJECT
SAMPLES