profileShare

rasmusjy / splitapp-backend-clean-onion

Read-only snapshot

No repository description.

main default branch 429 files Expires Sep 13, 2026, 9:06 AM
CurrencyBllDtoFactory.cs 684 bytes
1 using App.BLL.DTO;
2 using App.Domain;
3
4 namespace App.BLL.Mappers;
5
6 public static class CurrencyBllDtoFactory
7 {
8 public static CurrencyBllDto Create(Currency entity) => new()
9 {
10 Id = entity.Id,
11 CreatedAt = entity.CreatedAt,
12 UpdatedAt = entity.UpdatedAt,
13 Code = entity.Code,
14 Name = entity.Name,
15 Symbol = entity.Symbol
16 };
17
18 public static List<CurrencyBllDto> CreateList(IEnumerable<Currency> entities)
19 => entities.Select(Create).ToList();
20
21 public static Currency ToEntity(CurrencyBllDto dto) => new()
22 {
23 Id = dto.Id,
24 Code = dto.Code,
25 Name = dto.Name,
26 Symbol = dto.Symbol
27 };
28 }
29