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 | |
---|
1 | using FinkiChattery.Contracts.Questioning.GetCategories;
|
---|
2 | using FinkiChattery.Persistence.Models;
|
---|
3 | using System.Collections.Generic;
|
---|
4 | using System.Linq;
|
---|
5 |
|
---|
6 | namespace 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.