adds blueprints dictionary to ContentTypeBasic result
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.Serialization;
|
||||
@@ -18,6 +19,11 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
[DataContract(Name = "contentType", Namespace = "")]
|
||||
public class ContentTypeBasic : EntityBasic
|
||||
{
|
||||
public ContentTypeBasic()
|
||||
{
|
||||
Blueprints = new Dictionary<int, string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overridden to apply our own validation attributes since this is not always required for other classes
|
||||
/// </summary>
|
||||
@@ -105,5 +111,9 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
: IOHelper.ResolveUrl("~/umbraco/images/thumbnails/" + Thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
[DataMember(Name = "blueprints")]
|
||||
[ReadOnly(true)]
|
||||
public IDictionary<int, string> Blueprints { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,11 +163,14 @@ namespace Umbraco.Web.Models.Mapping
|
||||
});
|
||||
|
||||
config.CreateMap<IMemberType, ContentTypeBasic>()
|
||||
.ForMember(x => x.Udi, expression => expression.MapFrom(content => Udi.Create(Constants.UdiEntityType.MemberType, content.Key)));
|
||||
.ForMember(x => x.Udi, expression => expression.MapFrom(content => Udi.Create(Constants.UdiEntityType.MemberType, content.Key)))
|
||||
.ForMember(x => x.Blueprints, expression => expression.Ignore());
|
||||
config.CreateMap<IMediaType, ContentTypeBasic>()
|
||||
.ForMember(x => x.Udi, expression => expression.MapFrom(content => Udi.Create(Constants.UdiEntityType.MediaType, content.Key)));
|
||||
.ForMember(x => x.Udi, expression => expression.MapFrom(content => Udi.Create(Constants.UdiEntityType.MediaType, content.Key)))
|
||||
.ForMember(x => x.Blueprints, expression => expression.Ignore());
|
||||
config.CreateMap<IContentType, ContentTypeBasic>()
|
||||
.ForMember(x => x.Udi, expression => expression.MapFrom(content => Udi.Create(Constants.UdiEntityType.DocumentType, content.Key)));
|
||||
.ForMember(x => x.Udi, expression => expression.MapFrom(content => Udi.Create(Constants.UdiEntityType.DocumentType, content.Key)))
|
||||
.ForMember(x => x.Blueprints, expression => expression.Ignore());
|
||||
|
||||
config.CreateMap<PropertyTypeBasic, PropertyType>()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user