2016-01-21 15:01:55 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using AutoMapper;
|
|
|
|
|
|
using Umbraco.Web.Models.ContentEditing;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Models.Mapping
|
|
|
|
|
|
{
|
2017-07-19 13:42:47 +02:00
|
|
|
|
internal class PropertyGroupDisplayResolver<TSource, TPropertyTypeSource, TPropertyTypeDestination>
|
2016-01-21 15:59:58 +01:00
|
|
|
|
where TSource : ContentTypeSave<TPropertyTypeSource>
|
2017-07-20 11:21:28 +02:00
|
|
|
|
where TPropertyTypeDestination : PropertyTypeDisplay
|
2016-01-21 15:59:58 +01:00
|
|
|
|
where TPropertyTypeSource : PropertyTypeBasic
|
2016-01-21 15:01:55 +01:00
|
|
|
|
{
|
2017-07-19 13:42:47 +02:00
|
|
|
|
public IEnumerable<PropertyGroupDisplay<TPropertyTypeDestination>> Resolve(TSource source)
|
2016-01-21 15:01:55 +01:00
|
|
|
|
{
|
2016-01-21 15:59:58 +01:00
|
|
|
|
return source.Groups.Select(Mapper.Map<PropertyGroupDisplay<TPropertyTypeDestination>>);
|
2016-01-21 15:01:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|