Skip to content
Documentation

EnumerationController<TStruct,TValue> Class

Base class for controllers exposing endpoints for looking up known values of IEnumeration<TStruct> implementing types along with any additional properties that have been assigned to them.

public abstract class EnumerationController<TStruct,TValue> : Microsoft.AspNetCore.Mvc.Controller
where TStruct : struct, HAKOM.TSM.Net.Api.IEnumeration<TStruct, TValue>, System.IEquatable<TStruct>, System.ValueType, System.ValueType
where TValue : System.Numerics.INumber<TValue>

TStruct

The type of struct for which to expose endpoints.

TValue

Inheritance System.Object 🡒 Microsoft.AspNetCore.Mvc.ControllerBase 🡒 Microsoft.AspNetCore.Mvc.Controller 🡒 EnumerationController<TStruct,TValue>

Implementations must have a Microsoft.AspNetCore.Mvc.RouteAttribute specifying the root of the endpoints underneath.

EnumerationController(IEnumerable<IEnumerationPropertyProvider<TStruct>>, IHttpFailureFactory) Constructor

Section titled “EnumerationController(IEnumerable<IEnumerationPropertyProvider<TStruct>>, IHttpFailureFactory) Constructor”

Creates an instance of the controller. Call this from derived types.

protected EnumerationController(System.Collections.Generic.IEnumerable<HAKOM.TSM.Net.Api.IEnumerationPropertyProvider<TStruct>> propertyProviders, HAKOM.ErrorHandling.Http.Net.Api.IHttpFailureFactory httpFailureFactory);

propertyProviders System.Collections.Generic.IEnumerable<HAKOM.TSM.Net.Api.IEnumerationPropertyProvider<TStruct>>

A collection of all the registered IEnumerationPropertyProvider<TStruct> implementations for TStruct.

httpFailureFactory IHttpFailureFactory

Used to generate common errors.

EnumerationController<TStruct,TValue>.FindAllKnownEnumerations() Method

Section titled “EnumerationController<TStruct,TValue>.FindAllKnownEnumerations() Method”

Returns all known values of TStruct along with any properties mapped to it.

protected System.Collections.Generic.IEnumerable<HAKOM.TSM.Net.Api.IEnumeration<TStruct,TValue>> FindAllKnownEnumerations();

System.Collections.Generic.IEnumerable<HAKOM.TSM.Net.Api.IEnumeration<TStruct,TValue>>

Any value of TStruct is considered <i>known</i> if it has one or more properties mapped to it by an implementation of IEnumerationPropertyProvider<TStruct>.

EnumerationController<TStruct,TValue>.GetEnumerationByProperty(string, string) Method

Section titled “EnumerationController<TStruct,TValue>.GetEnumerationByProperty(string, string) Method”

Returns the TStruct with a property named propertyName mapped to a value of propertyValue along with any additional properties mapped to it.

protected HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.IEnumeration<TStruct,TValue>> GetEnumerationByProperty(string propertyName, string propertyValue);

propertyName System.String

The name of the property by which to look up the TStruct for which to retrieve its properties.

propertyValue System.String

The value of the property mapped to the TStruct for which to retrieve its properties.

HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.IEnumeration<TStruct,TValue>>
A Result indicating success or failure of retrieving the TStruct with the property identified by propertyName being mapped to the given propertyValue.

EnumerationController<TStruct,TValue>.GetEnumerationByValue(TValue) Method

Section titled “EnumerationController<TStruct,TValue>.GetEnumerationByValue(TValue) Method”

Returns the TStruct with the given value along with any additional properties mapped to it.

protected HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.IEnumeration<TStruct,TValue>> GetEnumerationByValue(TValue value);

value TValue

The value of the TStruct for which to retrieve its properties.

HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.IEnumeration<TStruct,TValue>>
A Result indicating success or failure of retrieving the TStruct with the given value.

EnumerationController<TStruct,TValue>.GetEnumerationPropertyByName(string, string) Method

Section titled “EnumerationController<TStruct,TValue>.GetEnumerationPropertyByName(string, string) Method”

Returns the value of the property identified by propertyName for the TStruct with the given name.

protected HAKOM.ErrorHandling.Core.Net.Api.Result<object> GetEnumerationPropertyByName(string name, string propertyName);

name System.String

The value of the TStruct for which to retrieve the value of the property with the given propertyName.

propertyName System.String

The name of the property for which to retrieve the value mapped to the TStruct with the given name.

HAKOM.ErrorHandling.Core.Net.Api.Result<System.Object>
A Result indicating success or failure of retrieving a value for the property of TStruct with the given name.

EnumerationController<TStruct,TValue>.GetEnumerationPropertyByValue(TValue, string) Method

Section titled “EnumerationController<TStruct,TValue>.GetEnumerationPropertyByValue(TValue, string) Method”

Returns the value of the property identified by propertyName for the TStruct with the given value.

protected HAKOM.ErrorHandling.Core.Net.Api.Result<object> GetEnumerationPropertyByValue(TValue value, string propertyName);

value TValue

The value of the TStruct for which to retrieve the value of the property with the given propertyName.

propertyName System.String

The name of the property for which to retrieve the value mapped to the TStruct with the given value.

HAKOM.ErrorHandling.Core.Net.Api.Result<System.Object>
A Result indicating success or failure of retrieving a value for the property of TStruct with the given value.

© 2026 Volue.Version v0.6.38017 November 2026