Completes U4-2390 Remove VersionID Guid in IPublishedContent properties
This commit is contained in:
@@ -13,17 +13,15 @@ namespace Umbraco.Core.Dynamics
|
||||
|
||||
Alias = source.Alias;
|
||||
Value = source.Value;
|
||||
Version = source.Version;
|
||||
PropertyType = type;
|
||||
}
|
||||
internal PropertyResult(string alias, object value, Guid version, PropertyResultType type)
|
||||
internal PropertyResult(string alias, object value, PropertyResultType type)
|
||||
{
|
||||
if (alias == null) throw new ArgumentNullException("alias");
|
||||
if (value == null) throw new ArgumentNullException("value");
|
||||
|
||||
Alias = alias;
|
||||
Value = value;
|
||||
Version = version;
|
||||
PropertyType = type;
|
||||
}
|
||||
|
||||
@@ -44,9 +42,6 @@ namespace Umbraco.Core.Dynamics
|
||||
}
|
||||
}
|
||||
|
||||
public Guid Version { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The Id of the document for which this property belongs to
|
||||
/// </summary>
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Umbraco.Core.Models
|
||||
public interface IPublishedContentProperty
|
||||
{
|
||||
string Alias { get; }
|
||||
object Value { get; }
|
||||
Guid Version { get; }
|
||||
object Value { get; }
|
||||
}
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
|
||||
//cache this lookup in a new custom (hidden) property
|
||||
publishedContent.Properties.Add(new PropertyResult("__recursive__" + fieldname, contentValue, Guid.Empty, PropertyResultType.CustomProperty));
|
||||
publishedContent.Properties.Add(new PropertyResult("__recursive__" + fieldname, contentValue, PropertyResultType.CustomProperty));
|
||||
|
||||
return contentValue;
|
||||
}
|
||||
|
||||
@@ -140,8 +140,8 @@ namespace Umbraco.Tests.PublishedContent
|
||||
Properties = new Collection<IPublishedContentProperty>(
|
||||
new List<IPublishedContentProperty>()
|
||||
{
|
||||
new PropertyResult("property1", "value" + indexVals, Guid.NewGuid(), PropertyResultType.UserProperty),
|
||||
new PropertyResult("property2", "value" + (indexVals + 1), Guid.NewGuid(), PropertyResultType.UserProperty)
|
||||
new PropertyResult("property1", "value" + indexVals, PropertyResultType.UserProperty),
|
||||
new PropertyResult("property2", "value" + (indexVals + 1), PropertyResultType.UserProperty)
|
||||
}),
|
||||
Children = new List<IPublishedContent>()
|
||||
};
|
||||
@@ -157,11 +157,11 @@ namespace Umbraco.Tests.PublishedContent
|
||||
if (!createChildren)
|
||||
{
|
||||
//create additional columns, used to test the different columns for child nodes
|
||||
d.Properties.Add(new PropertyResult("property4", "value" + (indexVals + 2), Guid.NewGuid(), PropertyResultType.UserProperty));
|
||||
d.Properties.Add(new PropertyResult("property4", "value" + (indexVals + 2), PropertyResultType.UserProperty));
|
||||
}
|
||||
else
|
||||
{
|
||||
d.Properties.Add(new PropertyResult("property3", "value" + (indexVals + 2), Guid.NewGuid(), PropertyResultType.UserProperty));
|
||||
d.Properties.Add(new PropertyResult("property3", "value" + (indexVals + 2), PropertyResultType.UserProperty));
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Umbraco.Web
|
||||
var doc = cache.GetById(result.Id);
|
||||
if (doc == null) continue; //skip if this doesn't exist in the cache
|
||||
doc.Properties.Add(
|
||||
new PropertyResult("examineScore", result.Score.ToString(), Guid.Empty, PropertyResultType.CustomProperty));
|
||||
new PropertyResult("examineScore", result.Score.ToString(), PropertyResultType.CustomProperty));
|
||||
list.Add(doc);
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace Umbraco.Web.Models
|
||||
|
||||
return !attempt.Success
|
||||
? null
|
||||
: new PropertyResult(alias, attempt.Result, Guid.Empty, PropertyResultType.ReflectedProperty)
|
||||
: new PropertyResult(alias, attempt.Result, PropertyResultType.ReflectedProperty)
|
||||
{
|
||||
DocumentTypeAlias = content.DocumentTypeAlias,
|
||||
DocumentId = content.Id
|
||||
|
||||
@@ -514,8 +514,8 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
{
|
||||
//this is taken from examine
|
||||
_properties.Add(i.Key.InvariantStartsWith("__")
|
||||
? new PropertyResult(i.Key, i.Value, Guid.Empty, PropertyResultType.CustomProperty)
|
||||
: new PropertyResult(i.Key, i.Value, Guid.Empty, PropertyResultType.UserProperty));
|
||||
? new PropertyResult(i.Key, i.Value, PropertyResultType.CustomProperty)
|
||||
: new PropertyResult(i.Key, i.Value, PropertyResultType.UserProperty));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace umbraco.MacroEngines
|
||||
}
|
||||
if (result != null)
|
||||
{
|
||||
return new PropertyResult(alias, string.Format("{0}", result), Guid.Empty) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
|
||||
return new PropertyResult(alias, string.Format("{0}", result)) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -188,7 +188,7 @@ namespace umbraco.MacroEngines
|
||||
}
|
||||
if (result != null)
|
||||
{
|
||||
return new PropertyResult(alias, string.Format("{0}", result), Guid.Empty) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
|
||||
return new PropertyResult(alias, string.Format("{0}", result)) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace umbraco.MacroEngines
|
||||
}
|
||||
Values.Add(result.Current.Name, value);
|
||||
propertyExists = true;
|
||||
return new PropertyResult(alias, value, Guid.Empty);
|
||||
return new PropertyResult(alias, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,7 +376,7 @@ namespace umbraco.MacroEngines
|
||||
return Values
|
||||
.Where(kvp => !internalProperties.Contains(kvp.Key))
|
||||
.ToList()
|
||||
.ConvertAll(kvp => new PropertyResult(kvp.Key, kvp.Value, Guid.Empty))
|
||||
.ConvertAll(kvp => new PropertyResult(kvp.Key, kvp.Value))
|
||||
.Cast<IProperty>()
|
||||
.ToList();
|
||||
}
|
||||
@@ -473,7 +473,7 @@ namespace umbraco.MacroEngines
|
||||
|| Values.TryGetValue(alias, out value))
|
||||
{
|
||||
propertyExists = true;
|
||||
return new PropertyResult(alias, value, Guid.Empty);
|
||||
return new PropertyResult(alias, value);
|
||||
}
|
||||
|
||||
propertyExists = false;
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace umbraco.MacroEngines
|
||||
{
|
||||
private string _alias;
|
||||
private string _value;
|
||||
private Guid _version;
|
||||
|
||||
public PropertyResult(IProperty source)
|
||||
{
|
||||
@@ -20,20 +19,17 @@ namespace umbraco.MacroEngines
|
||||
{
|
||||
this._alias = source.Alias;
|
||||
this._value = source.Value;
|
||||
this._version = source.Version;
|
||||
}
|
||||
}
|
||||
public PropertyResult(string alias, string value, Guid version)
|
||||
public PropertyResult(string alias, string value)
|
||||
{
|
||||
this._alias = alias;
|
||||
this._value = value;
|
||||
this._version = version;
|
||||
}
|
||||
public PropertyResult(Property source)
|
||||
{
|
||||
this._alias = source.PropertyType.Alias;
|
||||
this._value = string.Format("{0}", source.Value);
|
||||
this._version = source.VersionId;
|
||||
}
|
||||
public string Alias
|
||||
{
|
||||
@@ -44,12 +40,7 @@ namespace umbraco.MacroEngines
|
||||
{
|
||||
get { return _value; }
|
||||
}
|
||||
|
||||
public Guid Version
|
||||
{
|
||||
get { return _version; }
|
||||
}
|
||||
|
||||
|
||||
public bool IsNull()
|
||||
{
|
||||
return Value == null;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace umbraco.MacroEngines.Library
|
||||
|
||||
internal static IProperty ConvertToNodeProperty(this IPublishedContentProperty prop)
|
||||
{
|
||||
return new PropertyResult(prop.Alias, prop.Value.ToString(), prop.Version);
|
||||
return new PropertyResult(prop.Alias, prop.Value.ToString());
|
||||
}
|
||||
|
||||
internal static INode ConvertToNode(this IPublishedContent doc)
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace umbraco.interfaces
|
||||
{
|
||||
string Alias { get; }
|
||||
string Value { get; }
|
||||
Guid Version { get; }
|
||||
string ToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user