2019-03-26 10:39:50 +01:00
|
|
|
|
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>
|
2019-04-03 10:39:49 +02:00
|
|
|
|
public MapperContext(UmbracoMapper mapper)
|
2019-03-26 10:39:50 +01:00
|
|
|
|
{
|
|
|
|
|
|
Mapper = mapper;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the mapper.
|
|
|
|
|
|
/// </summary>
|
2019-04-03 10:39:49 +02:00
|
|
|
|
public UmbracoMapper Mapper { get;}
|
2019-03-26 10:39:50 +01:00
|
|
|
|
|
|
|
|
|
|
/// <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>());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|