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:
@@ -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>>);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user