using System;
using System.Collections;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
///
/// A Property contains a single piece of data
///
[Serializable]
[DataContract(IsReference = true)]
public class Property : Entity
{
private PropertyType _propertyType;
private Guid _version;
private object _value;
private readonly PropertyTags _tagSupport = new PropertyTags();
protected Property()
{ }
public Property(PropertyType propertyType)
{
_propertyType = propertyType;
}
public Property(PropertyType propertyType, object value)
{
_propertyType = propertyType;
Value = value;
}
public Property(int id, Guid version, PropertyType propertyType, object value)
{
Id = id;
_propertyType = propertyType;
_version = version;
Value = value;
}
private static readonly Lazy Ps = new Lazy();
private class PropertySelectors
{
public readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo(x => x.Value);
public readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo(x => x.Version);
public readonly DelegateEqualityComparer