mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
WIP Clean Architecture
Windows 8.1 App Uses keepasslib v2.44 (temporarily)
This commit is contained in:
27
ModernKeePass.Application/Entry/Models/EntryVm.cs
Normal file
27
ModernKeePass.Application/Entry/Models/EntryVm.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Drawing;
|
||||
using AutoMapper;
|
||||
using ModernKeePass.Application.Common.Mappings;
|
||||
using ModernKeePass.Domain.Entities;
|
||||
using ModernKeePass.Domain.Enums;
|
||||
|
||||
namespace ModernKeePass.Application.Entry.Models
|
||||
{
|
||||
public class EntryVm: IMapFrom<EntryEntity>
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
public Icon Icon { get; set; }
|
||||
public Color ForegroundColor { get; set; }
|
||||
public Color BackgroundColor { get; set; }
|
||||
|
||||
public void Mapping(Profile profile)
|
||||
{
|
||||
profile.CreateMap<EntryEntity, EntryVm>()
|
||||
.ForMember(d => d.Id, opts => opts.MapFrom(s => s.Id))
|
||||
.ForMember(d => d.Title, opts => opts.MapFrom(s => s.Name))
|
||||
.ForMember(d => d.Icon, opts => opts.MapFrom(s => s.Icon))
|
||||
.ForMember(d => d.ForegroundColor, opts => opts.MapFrom(s => s.ForegroundColor))
|
||||
.ForMember(d => d.BackgroundColor, opts => opts.MapFrom(s => s.BackgroundColor));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user