Files
mixtape/zero.Backoffice/Endpoints/Applications/ApplicationMapperProfile.cs
T
2021-12-09 14:18:38 +01:00

19 lines
562 B
C#

namespace zero.Backoffice.Endpoints.Applications;
public class ApplicationMapperProfile : ZeroMapperProfile
{
public override void Configure(IZeroMapper mapper)
{
mapper.Define<Application, ApplicationPresentation>((source, ctx) => new(), Map);
}
protected virtual void Map(Application source, ApplicationPresentation target, IZeroMapperContext ctx)
{
target.Id = source.Id;
target.Alias = source.Alias;
target.Name = source.Name;
target.ImageId = source.IconId.Or(source.ImageId);
target.IsActive = source.IsActive;
}
}