Projekt

Obecné

Profil

« Předchozí | Další » 

Revize b9c5b7dd

Přidáno uživatelem Vojtěch Bartička před více než 2 roky(ů)

Added tag-related DTOs and mapping

Zobrazit rozdíly:

Backend/Core/MapperProfiles/TagProfileEF.cs
1
using AutoMapper;
2
using Core.Entities;
3
using Models.Tags;
4
using System;
5
using System.Collections.Generic;
6
using System.Linq;
7
using System.Text;
8
using System.Threading.Tasks;
9

  
10
namespace Core.MapperProfiles
11
{
12
    public class TagProfileEF : Profile
13
    {
14
        public TagProfileEF()
15
        {
16
            CreateMap<TagCategory, TagCategoryInfo>();
17
            CreateMap<Tag, TagInfo>();
18
            CreateMap<SubTag, SubTagInfo>();
19
        }
20
    }
21
}
Backend/Models/Tags/SubTagInfo.cs
1
namespace Models.Tags
2
{
3
    public class SubTagInfo
4
    {
5
        public Guid Id { get; set; }
6
        public string Name { get; set; }
7
        public string Description { get; set; }
8
    }
9
}
Backend/Models/Tags/TagCategoryInfo.cs
1
namespace Models.Tags
2
{
3
    public class TagCategoryInfo
4
    {
5
        public Guid Id { get; set; }
6
        public string Name { get; set; }
7
        public string Description { get; set; }
8
        public string Color { get; set; }
9
        public List<TagInfo> Tags { get; set; }
10
    }
11
}
Backend/Models/Tags/TagInfo.cs
1
namespace Models.Tags
2
{
3
    public class TagInfo
4
    {
5
        public Guid Id { get; set; }
6
        public string Name { get; set; }
7
        public string Description { get; set; }
8
        public string Color { get; set; }
9
        public List<SubTagInfo> SubTags { get; set; }
10
    }
11
}
Backend/Models/Tags/TagTreeResponse.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6

  
7
namespace Models.Tags
8
{
9
    public class TagTreeResponse
10
    {
11
        public List<TagCategoryInfo> TagCategories { get; set; } = new();
12
    }
13
}

Také k dispozici: Unified diff