Class RestBehaviorModuleBase
Namespace: Cephalon.Behaviors.Http.Hosting
Assembly: Cephalon.Behaviors.Http.dll
Base class for modules that own behaviors and expose a public REST surface for some of them.
public abstract class RestBehaviorModuleBase : BehaviorModuleBase, IModuleLifecycle, IBehaviorOwnerModule, IRestModule, IModuleInheritance
Section titled “Inheritance”object ← ModuleBase ← BehaviorModuleBase ← RestBehaviorModuleBase
Implements
Section titled “Implements”IModuleLifecycle, IBehaviorOwnerModule, IRestModule, IModule
Inherited Members
Section titled “Inherited Members”BehaviorModuleBase.ConfigureBehaviors(IBehaviorModuleBuilder), ModuleBase.Descriptor, ModuleBase.ConfigureServices(IServiceCollection), ModuleBase.RegisterCapabilities(ICapabilityRegistry), ModuleBase.InitializeAsync(ModuleContext, CancellationToken), ModuleBase.StartAsync(ModuleContext, CancellationToken), ModuleBase.StopAsync(ModuleContext, CancellationToken), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
Section titled “Remarks”
This base class keeps behavior ownership host-agnostic through ConfigureBehaviors(...) and MapEndpoints(...).
Use
Methods
Section titled “Methods”ConfigureBehaviors(IBehaviorModuleBuilder)
Section titled “ ConfigureBehaviors(IBehaviorModuleBuilder)”Registers the behaviors owned by the current module.
public override sealed void ConfigureBehaviors(IBehaviorModuleBuilder behaviors)Parameters
Section titled “Parameters”behaviors IBehaviorModuleBuilder
The module-owned behavior builder.
ConfigureRestBehaviors(IRestBehaviorModuleBuilder)
Section titled “ ConfigureRestBehaviors(IRestBehaviorModuleBuilder)”Declares the module-owned behaviors and their public REST surface in one place.
public abstract void ConfigureRestBehaviors(IRestBehaviorModuleBuilder behaviors)Parameters
Section titled “Parameters”behaviors IRestBehaviorModuleBuilder
The REST behavior-module builder.
ConfigureServices(IServiceCollection)
Section titled “ ConfigureServices(IServiceCollection)”Configures services required by the module.
public override void ConfigureServices(IServiceCollection services)Parameters
Section titled “Parameters”services IServiceCollection
The service collection receiving module services.
GetRestBehaviorProfileSourceType()
Section titled “ GetRestBehaviorProfileSourceType()”Gets the marker type used to resolve generated REST profile metadata for the current module.
protected virtual Type GetRestBehaviorProfileSourceType()Returns
Section titled “Returns”The marker type whose assembly Cephalon should treat as the source for generated REST
profile hints when MapGeneratedProfiles(…) or
MapGeneratedProfileGroups(…) is used.
Remarks
Section titled “Remarks”Most modules should use the default implementation, which points at the concrete module type itself. Low-code wrappers can override this to point at a stable marker type from the behavior assembly when the module instance is implemented by a reusable helper type.
MapAdditionalEndpoints(IEndpointRouteBuilder)
Section titled “ MapAdditionalEndpoints(IEndpointRouteBuilder)”Adds any advanced/manual Minimal API endpoints that are not covered by the default REST behavior DSL.
protected virtual void MapAdditionalEndpoints(IEndpointRouteBuilder endpoints)Parameters
Section titled “Parameters”endpoints IEndpointRouteBuilder
The endpoint route builder receiving additional module endpoints.
Remarks
Section titled “Remarks”When a custom endpoint still dispatches into a Cephalon behavior, declare ownership first through
Internal<TBehavior>() so engine composition remains deterministic.