abstracts out the DocumentType, MemberType and MediaType editor models, since some contain different props than each other and now member properties contain different properties than each other. So we have a lot of generic insanity going on... it works though.

This commit is contained in:
Shannon
2016-01-21 15:01:55 +01:00
parent 504235d6db
commit 52b1a09de0
27 changed files with 377 additions and 177 deletions

View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Models.Mapping
{
internal class PropertyGroupDisplayResolver<TSource, TPropertyTypeDisplay> : ValueResolver<IEnumerable<TSource>, IEnumerable<PropertyGroupDisplay<TPropertyTypeDisplay>>>
where TSource : ContentTypeSave
where TPropertyTypeDisplay : PropertyTypeDisplay
{
protected override IEnumerable<PropertyGroupDisplay<TPropertyTypeDisplay>> ResolveCore(IEnumerable<TSource> source)
{
return source.Select(Mapper.Map<PropertyGroupDisplay<TPropertyTypeDisplay>>);
}
}
}