source: src/FinkiChattery/FinkiChattery.Api/ApplicationServices/Questioning/Mapper/CategoryMapper.cs@ 31c006c

dev
Last change on this file since 31c006c was 31c006c, checked in by Стојков Марко <mst@…>, 3 years ago

Add categories endpoint and state for categories, added questions preview component

  • Property mode set to 100644
File size: 632 bytes
Line 
1using FinkiChattery.Contracts.Questioning.GetCategories;
2using FinkiChattery.Persistence.Models;
3using System.Collections.Generic;
4using System.Linq;
5
6namespace FinkiChattery.Api.ApplicationServices.Questioning
7{
8 public static class CategoryMapper
9 {
10 public static List<CategoryDto> ToCategoryDtos(this IEnumerable<Category> categories)
11 {
12 var categoryDtos = new List<CategoryDto>();
13
14 if (categories.Any())
15 {
16 categoryDtos = categories.Select(x => new CategoryDto(x.Uid, x.Name)).ToList();
17 }
18
19 return categoryDtos;
20 }
21 }
22}
Note: See TracBrowser for help on using the repository browser.