OptionsModelRoot
public sealed class OptionsModelRoot
Namespace: RhoMicro.BindSight.Models
Inheritance:
Summary
Section titled “Summary”Models a registered option type.
Constructors
Section titled “Constructors”OptionsModelRoot(Type, EnrichmentFactory)
Section titled “OptionsModelRoot(Type, EnrichmentFactory)”public OptionsModelRoot(Type type, EnrichmentFactory enrichmentFactory)
Summary
Section titled “Summary”Initializes a new instance.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
enrichmentFactory | EnrichmentFactory | The enrichment factory to use when creating enrichments. |
type | Type | The modelled options type. |
OptionsModelRoot(Type, EnrichmentFactory, ConcurrentDictionary<Type, object>)
Section titled “OptionsModelRoot(Type, EnrichmentFactory, ConcurrentDictionary<Type, object>)”private OptionsModelRoot(Type type, EnrichmentFactory enrichmentFactory, ConcurrentDictionary<Type, object> enrichments)
Properties
Section titled “Properties”public Type Type { get; }
Summary
Section titled “Summary”Gets the modelled type.
Methods
Section titled “Methods”GetEnrichment<TEnrichment>()
Section titled “GetEnrichment<TEnrichment>()”public TEnrichment GetEnrichment<TEnrichment>() where TEnrichment : IOptionsModelRootEnrichment<TEnrichment>
Summary
Section titled “Summary”Gets an instance of the specified enrichment type. If an instance of the enrichment type is already attached to this instance, it is returned; otherwise, a new instance of the enrichment will be created and attached to this instance.
Type Parameters
Section titled “Type Parameters”Name | Description | Constraints |
---|---|---|
TEnrichment | The type of enrichment to get. | IOptionsModelRootEnrichment<TEnrichment> |
Returns
Section titled “Returns”The instance of TEnrichment attached to this instance.
WithEnrichment<TEnrichment>(TEnrichment)
Section titled “WithEnrichment<TEnrichment>(TEnrichment)”public OptionsModelRoot WithEnrichment<TEnrichment>(TEnrichment enrichment) where TEnrichment : IOptionsModelRootEnrichment<TEnrichment>
Summary
Section titled “Summary”Gets a copy of this instance with the specified type of enrichment replaced.
Type Parameters
Section titled “Type Parameters”Name | Description | Constraints |
---|---|---|
TEnrichment | The type of enrichment to attach to the returned copy. | IOptionsModelRootEnrichment<TEnrichment> |
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
enrichment | TEnrichment | The enrichment to attach to the returned copy. |
Returns
Section titled “Returns”A copy of this instance with the TEnrichment replaced by enrichment.
ToString()
Section titled “ToString()”public override string ToString()
Summary
Section titled “Summary”Returns a string that represents the current object.
Returns
Section titled “Returns”A string that represents the current object.
Equals(OptionsModelRoot)
Section titled “Equals(OptionsModelRoot)”public bool Equals(OptionsModelRoot? other)
Equals(object)
Section titled “Equals(object)”public override bool Equals(object? obj)
Summary
Section titled “Summary”Determines whether the specified object is equal to the current object.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
obj | Object | The object to compare with the current object. |
Returns
Section titled “Returns”true
if the specified object is equal to the current object; otherwise, false
.
GetHashCode()
Section titled “GetHashCode()”public override int GetHashCode()
Summary
Section titled “Summary”Serves as the default hash function.
Returns
Section titled “Returns”A hash code for the current object.