Files
Umbraco-CMS/src/Umbraco.Web/Models/Mapping/SectionModelMapper.cs

20 lines
674 B
C#
Raw Normal View History

using AutoMapper;
using Umbraco.Core;
using Umbraco.Core.Models.Mapping;
using Umbraco.Web.Models.ContentEditing;
2013-10-09 15:04:30 +02:00
using umbraco;
namespace Umbraco.Web.Models.Mapping
{
internal class SectionModelMapper : MapperConfiguration
{
public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
{
config.CreateMap<Core.Models.Section, Section>()
2013-10-09 15:04:30 +02:00
.ForMember(
dto => dto.Name,
expression => expression.MapFrom(section => ui.Text("sections", section.Alias)))
.ReverseMap(); //backwards too!
}
}
}