2020-05-04 14:13:03 +02:00
|
|
|
using zero.Core.Entities;
|
2020-05-09 11:42:45 +02:00
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|