Files
mixtape/zero.Web/Mapper/TranslationMapperConfig.cs
T

39 lines
1021 B
C#
Raw Normal View History

2020-05-04 14:13:03 +02:00
using zero.Core.Entities;
using zero.Core.Mapper;
2020-05-04 14:13:03 +02:00
using zero.Web.Models;
namespace zero.Web.Mapper
{
public class TranslationMapperConfig : IMapperConfig
{
/// <inheritdoc />
public void Configure(IMapper config)
{
config.CreateMap<Translation, TranslationEditModel>((source, target) =>
{
target.Id = source.Id;
target.CreatedDate = source.CreatedDate;
target.Key = source.Key;
target.Value = source.Value;
target.Display = source.Display;
});
config.CreateMap<TranslationEditModel, Translation>((source, target) =>
{
2020-05-09 20:34:10 +02:00
target.IsActive = true;
2020-05-04 14:13:03 +02:00
target.Key = source.Key;
target.Value = source.Value;
target.Display = source.Display;
});
config.CreateMap<Translation, TranslationListModel>((source, target) =>
{
target.Id = source.Id;
target.CreatedDate = source.CreatedDate;
target.Key = source.Key;
target.Value = source.Value;
});
}
}
}