Fixes EntityController to have a correct model mapper and removes invalidly named 'map' method. Removes the key from entity since we don't need it. Added some notes to the controller since we have to implement security for the results.
This commit is contained in:
17
src/Umbraco.Web/Models/Mapping/EntityModelMapper.cs
Normal file
17
src/Umbraco.Web/Models/Mapping/EntityModelMapper.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using AutoMapper;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
internal class EntityModelMapper : MapperConfiguration
|
||||
{
|
||||
public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
|
||||
{
|
||||
config.CreateMap<UmbracoEntity, EntityBasic>()
|
||||
.ForMember(basic => basic.Icon, expression => expression.MapFrom(entity => entity.ContentTypeIcon));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user