2016-11-15 09:14:55 +01:00
|
|
|
|
using AutoMapper;
|
2016-06-12 18:49:05 +02:00
|
|
|
|
using Umbraco.Core;
|
|
|
|
|
|
using Umbraco.Core.Models;
|
|
|
|
|
|
using Umbraco.Core.Models.Mapping;
|
|
|
|
|
|
using Umbraco.Web.Models.ContentEditing;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Models.Mapping
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class TemplateModelMapper : MapperConfiguration
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
|
|
|
|
|
|
{
|
2017-01-10 16:54:46 +01:00
|
|
|
|
config.CreateMap<ITemplate, TemplateDisplay>()
|
|
|
|
|
|
.ForMember(x => x.Notifications, exp => exp.Ignore());
|
2016-06-12 18:49:05 +02:00
|
|
|
|
|
|
|
|
|
|
config.CreateMap<TemplateDisplay, Template>()
|
2017-06-29 14:39:11 +10:00
|
|
|
|
.IgnoreDeletableEntityCommonProperties()
|
|
|
|
|
|
.ForMember(x => x.Path, exp => exp.Ignore())
|
2016-06-12 18:49:05 +02:00
|
|
|
|
.ForMember(x => x.VirtualPath, exp => exp.Ignore())
|
2016-11-15 09:14:55 +01:00
|
|
|
|
.ForMember(x => x.Path, exp => exp.Ignore())
|
|
|
|
|
|
.ForMember(x => x.MasterTemplateId, exp => exp.Ignore()) // ok, assigned when creating the template
|
|
|
|
|
|
.ForMember(x => x.IsMasterTemplate, exp => exp.Ignore())
|
|
|
|
|
|
.ForMember(x => x.HasIdentity, exp => exp.Ignore());
|
2016-06-12 18:49:05 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|