2016-04-13 21:21:20 +02:00
|
|
|
|
using System.Collections.Concurrent;
|
2012-12-17 11:16:09 -01:00
|
|
|
|
using Umbraco.Core.Models;
|
2017-12-28 09:06:33 +01:00
|
|
|
|
using Umbraco.Core.Persistence.Dtos;
|
2012-12-17 11:16:09 -01:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Persistence.Mappers
|
|
|
|
|
|
{
|
2013-03-13 01:09:29 +04:00
|
|
|
|
[MapperFor(typeof(Property))]
|
|
|
|
|
|
public sealed class PropertyMapper : BaseMapper
|
2012-12-17 11:16:09 -01:00
|
|
|
|
{
|
2013-07-02 17:47:20 +10:00
|
|
|
|
private static readonly ConcurrentDictionary<string, DtoMapModel> PropertyInfoCacheInstance = new ConcurrentDictionary<string, DtoMapModel>();
|
2012-12-17 11:16:09 -01:00
|
|
|
|
|
2016-04-13 21:21:20 +02:00
|
|
|
|
internal override ConcurrentDictionary<string, DtoMapModel> PropertyInfoCache => PropertyInfoCacheInstance;
|
2013-07-02 17:47:20 +10:00
|
|
|
|
|
2015-02-22 21:36:02 +01:00
|
|
|
|
protected override void BuildMap()
|
2012-12-17 11:16:09 -01:00
|
|
|
|
{
|
|
|
|
|
|
CacheMap<Property, PropertyDataDto>(src => src.Id, dto => dto.Id);
|
|
|
|
|
|
CacheMap<Property, PropertyDataDto>(src => src.PropertyTypeId, dto => dto.PropertyTypeId);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
|
}
|