WishlistMapper.cs
916 bytes
| 1 | using App.BLL.DTO; |
|---|---|
| 2 | using App.DTO.v1; |
| 3 | |
| 4 | namespace App.DTO.Mappers; |
| 5 | |
| 6 | public static class WishlistMapper |
| 7 | { |
| 8 | public static WishlistItemDto MapToDto(TripWishlistItemBllDto item, Guid currentUserId) |
| 9 | { |
| 10 | return new WishlistItemDto |
| 11 | { |
| 12 | Id = item.Id, |
| 13 | TripId = item.TripId, |
| 14 | AddedByUserId = item.AddedByUserId, |
| 15 | AddedByUserName = item.AddedByUserFullName, |
| 16 | Title = item.Title, |
| 17 | Description = item.Description, |
| 18 | Category = item.Category.ToString(), |
| 19 | Priority = item.Priority.ToString(), |
| 20 | EstimatedCost = item.EstimatedCost, |
| 21 | Url = item.Url, |
| 22 | Location = item.Location, |
| 23 | IsCompleted = item.IsCompleted, |
| 24 | VoteCount = item.VoteCount, |
| 25 | UserHasVoted = item.VoterUserIds.Contains(currentUserId), |
| 26 | DisplayOrder = item.DisplayOrder |
| 27 | }; |
| 28 | } |
| 29 | } |
| 30 | |