Files

33 lines
1.0 KiB
C#
Raw Permalink Normal View History

2020-04-01 19:37:30 +02:00
using System.Collections.Generic;
using AutoMapper;
using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Application.Common.Mappings;
using ModernKeePass.Application.Entry.Models;
using ModernKeePass.Domain.Entities;
using ModernKeePass.Domain.Enums;
namespace ModernKeePass.Application.Group.Models
{
2020-04-16 14:08:50 +02:00
public class GroupVm: IEntityVm, IMapFrom<GroupEntity>
{
2020-04-01 19:37:30 +02:00
public string ParentGroupId { get; set; }
public string ParentGroupName { get; set; }
public string Id { get; set; }
public string Title { get; set; }
public Icon Icon { get; set; }
public List<GroupVm> Groups { get; set; }
public List<EntryVm> Entries { get; set; }
public override string ToString()
{
return Title;
}
public void Mapping(Profile profile)
{
profile.CreateMap<GroupEntity, GroupVm>()
.ForMember(d => d.Title, opts => opts.MapFrom(s => s.Name))
.MaxDepth(2);
}
}
}