2020-05-05 13:13:19 +02:00
|
|
|
using zero.Core.Entities;
|
2020-05-09 11:42:45 +02:00
|
|
|
using zero.Core.Mapper;
|
2020-05-05 13:13:19 +02:00
|
|
|
using zero.Web.Models;
|
|
|
|
|
|
|
|
|
|
namespace zero.Web.Mapper
|
|
|
|
|
{
|
|
|
|
|
public class ApplicationMapperConfig : IMapperConfig
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public void Configure(IMapper config)
|
|
|
|
|
{
|
|
|
|
|
config.CreateMap<Application, ApplicationEditModel>((source, target) =>
|
|
|
|
|
{
|
|
|
|
|
target.Id = source.Id;
|
|
|
|
|
target.Name = source.Name;
|
|
|
|
|
target.FullName = source.FullName;
|
|
|
|
|
target.Email = source.Email;
|
|
|
|
|
target.IsActive = source.IsActive;
|
|
|
|
|
target.CreatedDate = source.CreatedDate;
|
|
|
|
|
target.Domains = source.Domains;
|
2020-05-15 14:23:47 +02:00
|
|
|
target.ImageId = source.ImageId;
|
|
|
|
|
target.IconId = source.IconId;
|
2020-05-05 13:13:19 +02:00
|
|
|
target.Features = source.Features;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
config.CreateMap<ApplicationEditModel, Application>((source, target) =>
|
|
|
|
|
{
|
|
|
|
|
target.Name = source.Name;
|
|
|
|
|
target.FullName = source.FullName;
|
|
|
|
|
target.Email = source.Email;
|
|
|
|
|
target.IsActive = source.IsActive;
|
|
|
|
|
target.Domains = source.Domains;
|
2020-05-15 14:23:47 +02:00
|
|
|
target.ImageId = source.ImageId;
|
|
|
|
|
target.IconId = source.IconId;
|
2020-05-05 13:13:19 +02:00
|
|
|
target.Features = source.Features;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
config.CreateMap<Application, ApplicationListModel>((source, target) =>
|
|
|
|
|
{
|
|
|
|
|
target.Id = source.Id;
|
|
|
|
|
target.Name = source.Name;
|
2020-05-08 14:33:45 +02:00
|
|
|
target.FullName = source.FullName;
|
2020-05-05 13:13:19 +02:00
|
|
|
target.IsActive = source.IsActive;
|
|
|
|
|
target.Domains = source.Domains;
|
2020-05-15 14:23:47 +02:00
|
|
|
target.ImageId = source.ImageId;
|
2020-05-05 13:13:19 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|