# Class MappingUtils

Namespace
  adas_core.Domain.Utils

Assembly
  adas-core.Domain.dll

Provides a sealed implementation of mapping utilities, serving as the concrete type for the IMappingUtils contract.

    public sealed class MappingUtils : IMappingUtils

Inheritance
  object
  MappingUtils

Implements
  IMappingUtils

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Constructors

### MappingUtils(IOptions<ApiSettings>)

    public MappingUtils(IOptions<ApiSettings> apiSettings)

#### Parameters

`apiSettings` IOptions<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

`name` string

  The name of the entry to look up in the CCC data.

`peso` double?

  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

`code` object

  The code used to look up the entity.

`category` string

  The category used to filter the search.

#### Returns

(string type, string name, string group)?

  A nullable tuple containing the type, name, and group of the found entity, or `null` if no match is found.