Exemplo n.º 1
0
 internal static TagCategory ToDto(Entities.TagCategory tagCategory, bool include_relations = false)
 {
     if (tagCategory == null)
     {
         return(null);
     }
     if (include_relations)
     {
         return(new TagCategory
         {
             Id = tagCategory.Id,
             Color = tagCategory.Color,
             Description = tagCategory.Description,
             Tags = tagCategory.Tags == null
                 ? new List <Tag>()
                 : tagCategory.Tags.Where(t => t.Parent == null).Select(t => TagRepository.ToDto(t)).ToList(),
             TotalTagCount = tagCategory.Tags == null
                 ? 0
                 : tagCategory.Tags.Count()
         });
     }
     else
     {
         return(new TagCategory
         {
             Id = tagCategory.Id,
             Color = tagCategory.Color,
             Description = tagCategory.Description
         });
     }
 }
Exemplo n.º 2
0
        internal static Entities.TagCategory ToEntity(TagCategory tagCategory, MintPlayerContext mintplayer_context)
        {
            if (tagCategory == null)
            {
                return(null);
            }
            var entity_tag_category = new Entities.TagCategory
            {
                Id          = tagCategory.Id,
                Color       = tagCategory.Color,
                Description = tagCategory.Description
            };

            return(entity_tag_category);
        }