Account Settings Mapper (IAccountSettingsMapper) Interface
Namespace: Cxt.Account.Settings.API.Abstractions
The IAccountSettingsMapper interface defines the contract for transforming AccountSettingsPreferencesDto collections (typically from data access) into the structured AccountSettingsResponse used by the API.
Purpose
- Abstracts data transformation, primarily converting
List<AccountSettingsPreferencesDto>(data store representation) intoAccountSettingsResponse(API client representation). - Enhances code organization and testability by decoupling mapping logic.
Methods
Map To Account Settings Response
csharp
AccountSettingsResponse MapToAccountSettingsResponse(List<AccountSettingsPreferencesDto> accountModel);- Description: Maps a list of
AccountSettingsPreferencesDtoobjects to a singleAccountSettingsResponse. - Parameters:
Parameter Type Description accountModelList<AccountSettingsPreferencesDto>The account preferences to map. - Returns:
AccountSettingsResponse- Populated and structured for API endpoints. (SeeAccountSettingsResponse)
Consumers and Implementers
- Consumers:
AccountSettingsService: Uses anIAccountSettingsMapperimplementation to format data fromIAccountSettingsClientfor API responses. (SeeCore API Servicesdocumentation, specifically theAccountSettingsService Class).
- Implementers:
- Concrete classes (e.g.,
AccountSettingsMapper) implement this interface, containing specific logic for DTO iteration, grouping byProfileId, and constructing theAccountSettingsResponse.
- Concrete classes (e.g.,