using AutoMapper; using ExpenseTracker.Application.Common.Mappings; using ExpenseTracker.Domain.Entities; namespace ExpenseTracker.Application.Accounts; public class AccountDto : IMapFrom { public string Id { get; set; } public string Name { get; set; } public string? Description { get; set; } public string Currency { get; set; } public string UserId { get; set; } public void Mapping(Profile profile) { profile.CreateMap() .ForMember(d => d.Currency, opt => opt.MapFrom(s => s.Currency.Name)); profile.CreateMap() .ForMember(d => d.Currency, opt => opt.MapFrom(s => Domain.Enums.Currency.FromName(s.Currency))); } }