diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
index 46f1aaf05e..db6dc4d88d 100644
--- a/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedContent.cs
@@ -13,7 +13,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// cached preview (so, maybe unpublished) content. A better name would therefore be ICachedContent, as
/// has been suggested. However, can't change now. Maybe in v7?
///
- public interface IPublishedContent : IPropertySet
+ public interface IPublishedContent : IPublishedElement
{
#region Content
diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs
index 7eb8909878..350e5970eb 100644
--- a/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedContentModelFactory.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// The original property set.
/// The strongly-typed model representing the property set, or the property set
/// itself it the factory has no model for that content type.
- IPropertySet CreateModel(IPropertySet set);
+ IPublishedElement CreateModel(IPublishedElement set);
///
/// Gets the model type map.
diff --git a/src/Umbraco.Core/Models/PublishedContent/IPropertySet.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedElement.cs
similarity index 93%
rename from src/Umbraco.Core/Models/PublishedContent/IPropertySet.cs
rename to src/Umbraco.Core/Models/PublishedContent/IPublishedElement.cs
index c2cf806c0b..45dcbd7c78 100644
--- a/src/Umbraco.Core/Models/PublishedContent/IPropertySet.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedElement.cs
@@ -4,9 +4,9 @@ using System.Collections.Generic;
namespace Umbraco.Core.Models.PublishedContent
{
///
- /// Represents a facade property set.
+ /// Represents a published element.
///
- public interface IPropertySet
+ public interface IPublishedElement
{
#region ContentType
@@ -17,7 +17,7 @@ namespace Umbraco.Core.Models.PublishedContent
#endregion
- #region PropertySet
+ #region PublishedElement
///
/// Gets the unique key of the facade item.
diff --git a/src/Umbraco.Core/Models/PublishedContent/NoopPublishedContentModelFactory.cs b/src/Umbraco.Core/Models/PublishedContent/NoopPublishedContentModelFactory.cs
index 16cd3a69d1..8264af9eb0 100644
--- a/src/Umbraco.Core/Models/PublishedContent/NoopPublishedContentModelFactory.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/NoopPublishedContentModelFactory.cs
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Models.PublishedContent
{
public class NoopPublishedContentModelFactory : IPublishedContentModelFactory
{
- public IPropertySet CreateModel(IPropertySet set)
+ public IPublishedElement CreateModel(IPublishedElement set)
=> set;
public Dictionary ModelTypeMap { get; } = new Dictionary();
diff --git a/src/Umbraco.Core/Models/PublishedContent/PropertySetModel.cs b/src/Umbraco.Core/Models/PublishedContent/PropertySetModel.cs
deleted file mode 100644
index ee087128ff..0000000000
--- a/src/Umbraco.Core/Models/PublishedContent/PropertySetModel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace Umbraco.Core.Models.PublishedContent
-{
- ///
- /// Represents a strongly-typed property set.
- ///
- /// Every strongly-typed property set class should inherit from PropertySetModel
- /// (or inherit from a class that inherits from... etc.) so they are picked by the factory.
- public class PropertySetModel : PropertySetWrapped
- {
- ///
- /// Initializes a new instance of the class with
- /// an original instance.
- ///
- /// The original content.
- protected PropertySetModel(IPropertySet content)
- : base(content)
- { }
- }
-}
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentModelFactory.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentModelFactory.cs
index c04aa7116a..cc6ac093b4 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentModelFactory.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentModelFactory.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Models.PublishedContent
private class ModelInfo
{
public Type ParameterType { get; set; }
- public Func Ctor { get; set; }
+ public Func Ctor { get; set; }
public Type ModelType { get; set; }
}
@@ -37,7 +37,7 @@ namespace Umbraco.Core.Models.PublishedContent
///
public PublishedContentModelFactory(IEnumerable types)
{
- var ctorArgTypes = new[] { typeof(IPropertySet) };
+ var ctorArgTypes = new[] { typeof(IPublishedElement) };
var modelInfos = new Dictionary(StringComparer.InvariantCultureIgnoreCase);
ModelTypeMap = new Dictionary(StringComparer.InvariantCultureIgnoreCase);
@@ -50,17 +50,17 @@ namespace Umbraco.Core.Models.PublishedContent
foreach (var ctor in type.GetConstructors())
{
var parms = ctor.GetParameters();
- if (parms.Length == 1 && typeof (IPropertySet).IsAssignableFrom(parms[0].ParameterType))
+ if (parms.Length == 1 && typeof (IPublishedElement).IsAssignableFrom(parms[0].ParameterType))
{
if (constructor != null)
- throw new InvalidOperationException($"Type {type.FullName} has more than one public constructor with one argument of type, or implementing, IPropertySet.");
+ throw new InvalidOperationException($"Type {type.FullName} has more than one public constructor with one argument of type, or implementing, IPublishedElement.");
constructor = ctor;
parameterType = parms[0].ParameterType;
}
}
if (constructor == null)
- throw new InvalidOperationException($"Type {type.FullName} is missing a public constructor with one argument of type, or implementing, IPropertySet.");
+ throw new InvalidOperationException($"Type {type.FullName} is missing a public constructor with one argument of type, or implementing, IPublishedElement.");
var attribute = type.GetCustomAttribute(false); // fixme rename FacadeModelAttribute
var typeName = attribute == null ? type.Name : attribute.ContentTypeAlias;
@@ -75,12 +75,12 @@ namespace Umbraco.Core.Models.PublishedContent
// much faster with a dynamic method but potential MediumTrust issues - which we don't support
// here http://stackoverflow.com/questions/16363838/how-do-you-call-a-constructor-via-an-expression-tree-on-an-existing-object
- var meth = new DynamicMethod(string.Empty, typeof(IPropertySet), ctorArgTypes, type.Module, true);
+ var meth = new DynamicMethod(string.Empty, typeof(IPublishedElement), ctorArgTypes, type.Module, true);
var gen = meth.GetILGenerator();
gen.Emit(OpCodes.Ldarg_0);
gen.Emit(OpCodes.Newobj, constructor);
gen.Emit(OpCodes.Ret);
- var func = (Func) meth.CreateDelegate(typeof (Func));
+ var func = (Func) meth.CreateDelegate(typeof (Func));
// fast enough and works in MediumTrust - but we don't
// read http://boxbinary.com/2011/10/how-to-run-a-unit-test-in-medium-trust-with-nunitpart-three-umbraco-framework-testing/
@@ -96,7 +96,7 @@ namespace Umbraco.Core.Models.PublishedContent
_modelInfos = modelInfos.Count > 0 ? modelInfos : null;
}
- public IPropertySet CreateModel(IPropertySet set)
+ public IPublishedElement CreateModel(IPublishedElement set)
{
// fail fast
if (_modelInfos == null)
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedElementModel.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedElementModel.cs
new file mode 100644
index 0000000000..e0514b38d7
--- /dev/null
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedElementModel.cs
@@ -0,0 +1,21 @@
+namespace Umbraco.Core.Models.PublishedContent
+{
+ ///
+ ///
+ /// Represents a strongly-typed published element.
+ ///
+ /// Every strongly-typed property set class should inherit from PublishedElementModel
+ /// (or inherit from a class that inherits from... etc.) so they are picked by the factory.
+ public class PublishedElementModel : PublishedElementWrapped
+ {
+ ///
+ ///
+ /// Initializes a new instance of the class with
+ /// an original instance.
+ ///
+ /// The original content.
+ protected PublishedElementModel(IPublishedElement content)
+ : base(content)
+ { }
+ }
+}
diff --git a/src/Umbraco.Core/Models/PublishedContent/PropertySetWrapped.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedElementWrapped.cs
similarity index 62%
rename from src/Umbraco.Core/Models/PublishedContent/PropertySetWrapped.cs
rename to src/Umbraco.Core/Models/PublishedContent/PublishedElementWrapped.cs
index 4041d43c8c..1989ac2caf 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PropertySetWrapped.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedElementWrapped.cs
@@ -4,19 +4,19 @@ using System.Collections.Generic;
namespace Umbraco.Core.Models.PublishedContent
{
///
- /// Provides an abstract base class for IPropertySet implementations that
- /// wrap and extend another IPropertySet.
+ /// Provides an abstract base class for IPublishedElement implementations that
+ /// wrap and extend another IPublishedElement.
///
- public abstract class PropertySetWrapped : IPropertySet
+ public abstract class PublishedElementWrapped : IPublishedElement
{
- private readonly IPropertySet _content;
+ private readonly IPublishedElement _content;
///
- /// Initializes a new instance of the class
- /// with an IPropertySet instance to wrap.
+ /// Initializes a new instance of the class
+ /// with an IPublishedElement instance to wrap.
///
/// The content to wrap.
- protected PropertySetWrapped(IPropertySet content)
+ protected PublishedElementWrapped(IPublishedElement content)
{
_content = content;
}
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// Gets the wrapped content.
///
/// The wrapped content, that was passed as an argument to the constructor.
- public IPropertySet Unwrap() => _content;
+ public IPublishedElement Unwrap() => _content;
///
public PublishedContentType ContentType => _content.ContentType;
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
index 35eda44551..6e64822594 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
@@ -217,7 +217,7 @@ namespace Umbraco.Core.Models.PublishedContent
// uses converters, else falls back to dark (& performance-wise expensive) magic
// source: the property source value
// preview: whether we are previewing or not
- public object ConvertSourceToInter(IPropertySet owner, object source, bool preview)
+ public object ConvertSourceToInter(IPublishedElement owner, object source, bool preview)
{
if (!_initialized) Initialize();
@@ -231,7 +231,7 @@ namespace Umbraco.Core.Models.PublishedContent
// uses converters, else returns the inter value
// inter: the property inter value
// preview: whether we are previewing or not
- public object ConvertInterToObject(IPropertySet owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public object ConvertInterToObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
if (!_initialized) Initialize();
@@ -246,7 +246,7 @@ namespace Umbraco.Core.Models.PublishedContent
// if successful, returns either a string or an XPathNavigator
// inter: the property inter value
// preview: whether we are previewing or not
- public object ConvertInterToXPath(IPropertySet owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public object ConvertInterToXPath(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
if (!_initialized) Initialize();
diff --git a/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs b/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs
index a28fd7abef..28ac22a567 100644
--- a/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs
@@ -51,7 +51,7 @@ namespace Umbraco.Core.PropertyEditors
/// strings, and xml-whitespace strings appropriately, ie it should know whether to preserve
/// whitespaces.
///
- object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview);
+ object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview);
///
/// Converts a property intermediate value to an Object value.
@@ -70,7 +70,7 @@ namespace Umbraco.Core.PropertyEditors
/// passed to eg a PublishedFragment constructor. It is used by the fragment and the properties to manage
/// the cache levels of property values. It is not meant to be used by the converter.
///
- object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview);
+ object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview);
///
/// Converts a property intermediate value to an XPath value.
@@ -94,6 +94,6 @@ namespace Umbraco.Core.PropertyEditors
/// passed to eg a PublishedFragment constructor. It is used by the fragment and the properties to manage
/// the cache levels of property values. It is not meant to be used by the converter.
///
- object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview);
+ object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview);
}
}
diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs
index 5a5e36e815..849886c66b 100644
--- a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs
+++ b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs
@@ -23,17 +23,17 @@ namespace Umbraco.Core.PropertyEditors
return PropertyCacheLevel.Facade;
}
- public virtual object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public virtual object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
return source;
}
- public virtual object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public virtual object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
return inter;
}
- public virtual object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public virtual object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
return inter?.ToString() ?? string.Empty;
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs
index d61cbaec60..85fdf9bc0b 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/CheckboxListValueConverter.cs
@@ -19,7 +19,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
{
var sourceString = source?.ToString() ?? string.Empty;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs
index 13e05aa01e..1f16c3e12a 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/ColorPickerValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
// make sure it's a string
return source?.ToString() ?? string.Empty;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs
index cf09be3008..100dbba575 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DatePickerValueConverter.cs
@@ -23,7 +23,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null) return DateTime.MinValue;
@@ -45,7 +45,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
// default ConvertSourceToObject just returns source ie a DateTime value
- public override object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a DateTime already
return XmlConvert.ToString((DateTime) inter, XmlDateTimeSerializationMode.Unspecified);
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs
index 2e1c527caf..b8652c4d3c 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DecimalValueConverter.cs
@@ -16,7 +16,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null) return 0M;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs
index e605b507f6..412d47ad96 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleValueConverter.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
{
var sourceString = (source ?? "").ToString();
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs
index e2305cfa6b..e032674fb8 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListMultipleWithKeysValueConverter.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null)
return new int[] { };
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs
index 007abd62e2..2f071935cd 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
return source?.ToString() ?? string.Empty;
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs
index 2c7747fa74..a70d600d37 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/DropdownListWithKeysValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
var intAttempt = source.TryConvertTo();
if (intAttempt.Success)
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs
index 7bc1e37c5c..0e646f4e1f 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/EmailAddressValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
{
return source?.ToString() ?? string.Empty;
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs
index 5f60cfb317..3a403e3222 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/GridValueConverter.cs
@@ -28,7 +28,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null) return null;
var sourceString = source.ToString();
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
index 15c580ab01..28686c0b4a 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs
@@ -93,7 +93,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
}
}
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null) return null;
var sourceString = source.ToString();
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs
index c75fa5ad9d..51405f5132 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null) return 0;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
index f426ccbf0d..4645f8bf3d 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/JsonValueConverter.cs
@@ -34,7 +34,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null) return null;
var sourceString = source.ToString();
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs
index 4f4523281f..b9990ae7cb 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs
@@ -24,7 +24,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
return source?.ToString() ?? string.Empty;
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs
index d5870ba104..b95840c2ae 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MarkdownEditorValueConverter.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
// in xml a string is: string
// in the database a string is: string
@@ -25,13 +25,13 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
return source;
}
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a string (or null) already
return new HtmlString(inter == null ? string.Empty : (string) inter);
}
- public override object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a string (or null) already
return inter?.ToString() ?? string.Empty;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs
index 68727676b4..2d3aaa9d19 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberGroupPickerValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
return source?.ToString() ?? string.Empty;
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MultipleTextStringValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MultipleTextStringValueConverter.cs
index 6de2951a89..67a76462f2 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MultipleTextStringValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MultipleTextStringValueConverter.cs
@@ -18,7 +18,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
// data is (both in database and xml):
//
@@ -56,7 +56,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
: values.ToArray();
}
- public override object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
var d = new XmlDocument();
var e = d.CreateElement("values");
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs
index d6da92d2f1..4a8b50e009 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MustBeStringValueConverter.cs
@@ -32,7 +32,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
return source?.ToString();
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs
index 15ad3f518c..dc38a4ed85 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/RadioButtonListValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
var intAttempt = source.TryConvertTo();
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
index 0733d71154..61b3068dee 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
{
if (source == null)
return null;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs
index 4d4994c954..ccc0713cf6 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs
@@ -28,7 +28,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
// if Json storage type deserialzie and return as string array
if (JsonStorageType(propertyType.DataTypeId))
@@ -45,7 +45,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
return csvTags;
}
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
{
return (string[]) source;
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs
index 1f556d03c4..cef7656421 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/TextStringValueConverter.cs
@@ -22,7 +22,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
// in xml a string is: string
// in the database a string is: string
@@ -30,13 +30,13 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
return source;
}
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a string (or null) already
return inter ?? string.Empty;
}
- public override object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a string (or null) already
return inter;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
index ff788f91c4..ae4cb1a701 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
@@ -20,7 +20,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
// in xml a string is: string
// in the database a string is: string
@@ -28,13 +28,13 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
return source;
}
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a string (or null) already
return new HtmlString(inter == null ? string.Empty : (string)inter);
}
- public override object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a string (or null) already
return inter;
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs
index 3014d7a60d..52176126ad 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/UploadPropertyConverter.cs
@@ -18,7 +18,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview)
{
return source?.ToString() ?? "";
}
diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/YesNoValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/YesNoValueConverter.cs
index 153f209ccf..c3f2ca2290 100644
--- a/src/Umbraco.Core/PropertyEditors/ValueConverters/YesNoValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/YesNoValueConverter.cs
@@ -15,7 +15,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
// in xml a boolean is: string
// in the database a boolean is: string "1" or "0" or empty
@@ -45,7 +45,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
// default ConvertSourceToObject just returns source ie a boolean value
- public override object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
// source should come from ConvertSource and be a boolean already
return (bool)inter ? "1" : "0";
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index 5615339fb3..ae251bea45 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -645,14 +645,14 @@
-
+
-
-
+
+
diff --git a/src/Umbraco.Tests/PublishedContent/ModelsAndConvertersTests.cs b/src/Umbraco.Tests/PublishedContent/ModelsAndConvertersTests.cs
index 1b07082ab5..244d7f7e32 100644
--- a/src/Umbraco.Tests/PublishedContent/ModelsAndConvertersTests.cs
+++ b/src/Umbraco.Tests/PublishedContent/ModelsAndConvertersTests.cs
@@ -79,7 +79,7 @@ namespace Umbraco.Tests.PublishedContent
new PublishedPropertyType("prop1", "editor1", converters),
});
- var set1 = new PropertySet(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "1234" } }, false);
+ var set1 = new PublishedElement(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "1234" } }, false);
Assert.AreEqual(1234, set1.Value("prop1"));
}
@@ -95,13 +95,13 @@ namespace Umbraco.Tests.PublishedContent
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Content;
- public object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
=> int.TryParse(source as string, out int i) ? i : 0;
- public object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
=> (int) inter;
- public object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
=> ((int) inter).ToString();
}
@@ -131,7 +131,7 @@ namespace Umbraco.Tests.PublishedContent
new PublishedPropertyType("prop1", "editor2", converters),
});
- var set1 = new PropertySet(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "1234" } }, false);
+ var set1 = new PublishedElement(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "1234" } }, false);
var cntType1 = new PublishedContentType(1001, "cnt1", Array.Empty());
var cnt1 = new TestPublishedContent(cntType1, 1234, Guid.NewGuid(), new Dictionary(), false);
@@ -164,13 +164,13 @@ namespace Umbraco.Tests.PublishedContent
public PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> _cacheLevel;
- public object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
=> int.TryParse(source as string, out int i) ? i : -1;
- public object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
=> _facadeAccessor.Facade.ContentCache.GetById((int) inter);
- public object ConvertInterToXPath(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public object ConvertInterToXPath(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
=> ((int) inter).ToString();
}
@@ -225,8 +225,8 @@ namespace Umbraco.Tests.PublishedContent
new PublishedPropertyType("prop2", "editor2"),
});
- var set1 = new PropertySet(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "val1" } }, false);
- var set2 = new PropertySet(setType2, Guid.NewGuid(), new Dictionary { { "prop2", "1003" } }, false);
+ var set1 = new PublishedElement(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "val1" } }, false);
+ var set2 = new PublishedElement(setType2, Guid.NewGuid(), new Dictionary { { "prop2", "1003" } }, false);
var cnt1 = new TestPublishedContent(contentType1, 1003, Guid.NewGuid(), new Dictionary { { "prop1", "val1" } }, false);
var cnt2 = new TestPublishedContent(contentType2, 1004, Guid.NewGuid(), new Dictionary { { "prop2", "1003" } }, false);
@@ -292,13 +292,13 @@ namespace Umbraco.Tests.PublishedContent
public override PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType)
=> PropertyCacheLevel.Snapshot;
- public override object ConvertSourceToInter(IPropertySet owner, PublishedPropertyType propertyType, object source, bool preview)
+ public override object ConvertSourceToInter(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview)
{
var s = source as string;
return s?.Split(',').Select(int.Parse).ToArray() ?? Array.Empty();
}
- public override object ConvertInterToObject(IPropertySet owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
+ public override object ConvertInterToObject(IPublishedElement owner, PublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
{
return ((int[]) inter).Select(x => (TestContentModel1) _facadeAccessor.Facade.ContentCache.GetById(x)).ToArray();
}
@@ -339,7 +339,7 @@ namespace Umbraco.Tests.PublishedContent
//
// for standalone property sets, it's only None or Content
- var set1 = new PropertySet(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "1234" } }, false);
+ var set1 = new PublishedElement(setType1, Guid.NewGuid(), new Dictionary { { "prop1", "1234" } }, false);
Assert.AreEqual(1234, set1.Value("prop1"));
Assert.AreEqual(1, converter.SourceConverts);
@@ -405,11 +405,11 @@ namespace Umbraco.Tests.PublishedContent
var facadeServiceMock = new Mock();
facadeServiceMock
- .Setup(x => x.CreateSetProperty(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny