Files
Umbraco-CMS/src/Umbraco.Web/Models/Mapping/PropertyGroupDisplayResolver.cs
2017-07-20 11:21:28 +02:00

19 lines
669 B
C#

using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Models.Mapping
{
internal class PropertyGroupDisplayResolver<TSource, TPropertyTypeSource, TPropertyTypeDestination>
where TSource : ContentTypeSave<TPropertyTypeSource>
where TPropertyTypeDestination : PropertyTypeDisplay
where TPropertyTypeSource : PropertyTypeBasic
{
public IEnumerable<PropertyGroupDisplay<TPropertyTypeDestination>> Resolve(TSource source)
{
return source.Groups.Select(Mapper.Map<PropertyGroupDisplay<TPropertyTypeDestination>>);
}
}
}