OptionsModel
public sealed class OptionsModel
Namespace: RhoMicro.BindSight.Models
Inheritance:
Summary
Section titled “Summary”Represents an options registration.
Constructors
Section titled “Constructors”OptionsModel(OptionsModelRoot, ImmutableHashSet<OptionsModelChild>, EnrichmentFactory)
Section titled “OptionsModel(OptionsModelRoot, ImmutableHashSet<OptionsModelChild>, EnrichmentFactory)”public OptionsModel(OptionsModelRoot root, ImmutableHashSet<OptionsModelChild> children, EnrichmentFactory enrichmentFactory)
Summary
Section titled “Summary”Initializes a new instance.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
children | ImmutableHashSet<OptionsModelChild> | The models of bound object graphs defined by root properties. |
enrichmentFactory | EnrichmentFactory | The factory used to create enrichments to the new model instance. |
root | OptionsModelRoot | The model of the registered options type. |
OptionsModel(OptionsModelRoot, EnrichmentFactory)
Section titled “OptionsModel(OptionsModelRoot, EnrichmentFactory)”public OptionsModel(OptionsModelRoot root, EnrichmentFactory enrichmentFactory)
Summary
Section titled “Summary”Initializes a new instance.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
enrichmentFactory | EnrichmentFactory | The factory used to create enrichments to the new model instance. |
root | OptionsModelRoot | The model of the registered options type. |
OptionsModel(OptionsModelRoot, ImmutableHashSet<OptionsModelChild>, EnrichmentFactory, ConcurrentDictionary<Type, object>)
Section titled “OptionsModel(OptionsModelRoot, ImmutableHashSet<OptionsModelChild>, EnrichmentFactory, ConcurrentDictionary<Type, object>)”private OptionsModel(OptionsModelRoot root, ImmutableHashSet<OptionsModelChild>? children, EnrichmentFactory enrichmentFactory, ConcurrentDictionary<Type, object> enrichments)
Properties
Section titled “Properties”public OptionsModelRoot Root { get; }
Summary
Section titled “Summary”Gets the model of the registered options type.
Children
Section titled “Children”public ImmutableHashSet<OptionsModelChild> Children { get; }
Summary
Section titled “Summary”Gets the models of bound object graphs defined by root properties.
Methods
Section titled “Methods”WithRoot(OptionsModelRoot)
Section titled “WithRoot(OptionsModelRoot)”public OptionsModel WithRoot(OptionsModelRoot root)
Summary
Section titled “Summary”Creates a copy of this instance with OptionsModel.Root replaced.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
root | OptionsModelRoot | The value to replace OptionsModel.Root with. |
Returns
Section titled “Returns”A copy of this instance with OptionsModel.Root replaced by root.
WithChildren(ImmutableHashSet<OptionsModelChild>)
Section titled “WithChildren(ImmutableHashSet<OptionsModelChild>)”public OptionsModel WithChildren(ImmutableHashSet<OptionsModelChild> children)
Summary
Section titled “Summary”Creates a copy of this instance with OptionsModel.Children replaced.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
children | ImmutableHashSet<OptionsModelChild> | The value to replace OptionsModel.Children with. |
Returns
Section titled “Returns”A copy of this instance with OptionsModel.Children replaced by children.
GetEnrichment<TEnrichment>()
Section titled “GetEnrichment<TEnrichment>()”public TEnrichment GetEnrichment<TEnrichment>() where TEnrichment : IOptionsModelEnrichment<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. | IOptionsModelEnrichment<TEnrichment> |
Returns
Section titled “Returns”The instance of TEnrichment attached to this instance.
WithEnrichment<TEnrichment>(TEnrichment)
Section titled “WithEnrichment<TEnrichment>(TEnrichment)”public OptionsModel WithEnrichment<TEnrichment>(TEnrichment enrichment) where TEnrichment : IOptionsModelEnrichment<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. | IOptionsModelEnrichment<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.
Create(Type, EnrichmentFactory)
Section titled “Create(Type, EnrichmentFactory)”public static OptionsModel Create(Type type, EnrichmentFactory enrichmentFactory)
Summary
Section titled “Summary”Creates a new instance using default creation options.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
enrichmentFactory | EnrichmentFactory | The enrichment factory to be used by the created instance when creating enrichments. |
type | Type | The options type to model. |
Returns
Section titled “Returns”A new model of the options type.
Create(Type, EnrichmentFactory, OptionsModelCreationOptions)
Section titled “Create(Type, EnrichmentFactory, OptionsModelCreationOptions)”public static OptionsModel Create(Type type, EnrichmentFactory enrichmentFactory, OptionsModelCreationOptions options)
Summary
Section titled “Summary”Creates a new instance.
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
enrichmentFactory | EnrichmentFactory | The enrichment factory to be used by the created instance when creating enrichments. |
options | OptionsModelCreationOptions | The options to use when creating the model. |
type | Type | The options type to model. |
Returns
Section titled “Returns”A new model of the options type.
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(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
.
Equals(OptionsModel)
Section titled “Equals(OptionsModel)”public bool Equals(OptionsModel? other)
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.