Class MappingUtils
Provides a sealed implementation of mapping utilities, serving as the concrete type for the IMappingUtils contract.
public sealed class MappingUtils : IMappingUtils
- Inheritance
-
MappingUtils
- Implements
- Inherited Members
- Extension Methods
Constructors
MappingUtils(IOptions<ApiSettings>)
public MappingUtils(IOptions<ApiSettings> apiSettings)
Parameters
apiSettingsIOptions<ApiSettings>
Methods
GetComplexityValue(string, double?)
Retrieves a complexity value from the CCC data mapping by matching the provided name.
If a single value entry exists for the name, its initial value is returned as an integer; if multiple ranges are defined, the value contributed by the range containing the optional peso is returned. Returns 0 when no matching name is found or when the data is not available.
public int GetComplexityValue(string name, double? peso = null)
Parameters
namestringThe name of the entry to look up in the CCC data.
pesodouble?Optional weight used to select the matching range when multiple values are defined; when null, range-based lookup is skipped.
Returns
- int
The matched initial value (for single-entry entries) or the contributed value (for range-based entries); returns 0 if the name is not found or no data is available.
SearchByCode(object, string)
Searches for an entity by its code within the specified category and returns its type, name, and group.
public (string type, string name, string group)? SearchByCode(object code, string category)
Parameters
codeobjectThe code used to look up the entity.
categorystringThe category used to filter the search.