21 lines
784 B
C#
21 lines
784 B
C#
using System.Collections.Concurrent;
|
|
using Umbraco.Core.Models;
|
|
using Umbraco.Core.Persistence.Dtos;
|
|
|
|
namespace Umbraco.Core.Persistence.Mappers
|
|
{
|
|
[MapperFor(typeof(Property))]
|
|
public sealed class PropertyMapper : BaseMapper
|
|
{
|
|
private static readonly ConcurrentDictionary<string, DtoMapModel> PropertyInfoCacheInstance = new ConcurrentDictionary<string, DtoMapModel>();
|
|
|
|
internal override ConcurrentDictionary<string, DtoMapModel> PropertyInfoCache => PropertyInfoCacheInstance;
|
|
|
|
protected override void BuildMap()
|
|
{
|
|
CacheMap<Property, PropertyDataDto>(src => src.Id, dto => dto.Id);
|
|
CacheMap<Property, PropertyDataDto>(src => src.PropertyTypeId, dto => dto.PropertyTypeId);
|
|
}
|
|
}
|
|
}
|