using Contracts.DTO; using Contracts.ViewModels; namespace Contracts.Mappers; public static class SpendingGroupMapper { public static SpendingGroupViewModel ToView(this SpendingGroupDto dto) => new() { Id = dto.Id, Name = dto.Name, ChangeRecords = dto.ChangeRecords.Select(x => x.ToView()).ToList(), SpendingPlans = dto.SpendingPlans.Select(x => x.ToView()).ToList() }; }