hoeyi / Ozym

A web-application for tracking personal finances. Built using Blazor, ASP.NET Core, and Entity Framework Core.
3 stars 0 forks source link

Add AutoMapper profiles #208

Closed hoeyi closed 1 year ago

hoeyi commented 1 year ago

Description

AutoMapper is being used to handle mapping the new DTO classes in DataTransfer.Common to the entity models and vice versa. To keep mapping organized, a profile will be created for key collections of like items, typically representing the simplest possible object graph possible that supports the require read/write operations for those objects. The goal of each profile is to have each represent the smallest testable configuration. Each profile should pass AutoMapper.MapperConfiguration.AssertConfigurationIsValid, with minimal prerequisites. It is expected that adding ModelAttributeProfile will be required for all other profiles.

Example

The AccountProfile class contains mappings for AccountDto, AccountCompositeDto, AccountCompositeMemberDto, and AccountBaseAttributeDto because the the first two items contain references to the latter two (the latter two may also have references to the first two).

It is OK to group related items, even if there is no explicit reference between the two, e.g., MarketHolidayDto and MarketHolidayObservanceDto.

Criteria

Include profiles for the following base objects: