Refactor more mappers

This commit is contained in:
Stephan
2019-03-26 10:39:50 +01:00
parent 92139dd0c9
commit d274737296
39 changed files with 1365 additions and 1121 deletions

View File

@@ -0,0 +1,35 @@
using System.Collections.Generic;
namespace Umbraco.Core.Mapping
{
/// <summary>
/// Represents a mapper context.
/// </summary>
public class MapperContext
{
private IDictionary<string, object> _items;
/// <summary>
/// Initializes a new instance of the <see cref="MapperContext"/> class.
/// </summary>
public MapperContext(Mapper mapper)
{
Mapper = mapper;
}
/// <summary>
/// Gets the mapper.
/// </summary>
public Mapper Mapper { get;}
/// <summary>
/// Gets a value indicating whether the context has items.
/// </summary>
public bool HasItems => _items != null;
/// <summary>
/// Gets the context items.
/// </summary>
public IDictionary<string, object> Items => _items ?? (_items = new Dictionary<string, object>());
}
}