diff --git a/ToSic.Eav.Core/Data/Decorators/IHasDecoratorExtensions.cs b/ToSic.Eav.Core/Data/Decorators/IHasDecoratorExtensions.cs index 10e48ae67..42ef632c3 100644 --- a/ToSic.Eav.Core/Data/Decorators/IHasDecoratorExtensions.cs +++ b/ToSic.Eav.Core/Data/Decorators/IHasDecoratorExtensions.cs @@ -17,11 +17,11 @@ public static TDecorator GetDecorator(this IEntity parent) where TDe return parentWithDecorator.GetDecorator(); } - public static TDecorator GetDecorator(this IContentType parent) where TDecorator : class, IDecorator - { - if (!(parent is IHasDecorators parentWithDecorator)) return null; - return parentWithDecorator.GetDecorator(); - } + //public static TDecorator GetDecorator(this IContentType parent) where TDecorator : class, IDecorator + //{ + // if (!(parent is IHasDecorators parentWithDecorator)) return null; + // return parentWithDecorator.GetDecorator(); + //} } } diff --git a/ToSic.Eav.Core/Data/Entities/EntityDecorator12.cs b/ToSic.Eav.Core/Data/Entities/EntityDecorator12.cs index 8211e0e14..36b9d4153 100644 --- a/ToSic.Eav.Core/Data/Entities/EntityDecorator12.cs +++ b/ToSic.Eav.Core/Data/Entities/EntityDecorator12.cs @@ -3,7 +3,7 @@ namespace ToSic.Eav.Data { [PrivateApi("Still WIP")] - public class EntityDecorator12: EntityDecorator where T: IDecorator + public class EntityDecorator12: EntityWrapper where T: IDecorator { protected T Decorator; diff --git a/ToSic.Eav.Core/Data/Entities/EntityWrapper.Equality.cs b/ToSic.Eav.Core/Data/Entities/EntityWrapper.Equality.cs index c32c043ec..9d968f051 100644 --- a/ToSic.Eav.Core/Data/Entities/EntityWrapper.Equality.cs +++ b/ToSic.Eav.Core/Data/Entities/EntityWrapper.Equality.cs @@ -2,13 +2,13 @@ namespace ToSic.Eav.Data { - public partial class EntityDecorator: IEquatable + public partial class EntityWrapper: IEquatable { public IEntity EntityForEqualityCheck { get; } - public static bool operator ==(EntityDecorator d1, IEntityWrapper d2) => EntityWrapperEquality.IsEqual(d1, d2); + public static bool operator ==(EntityWrapper d1, IEntityWrapper d2) => EntityWrapperEquality.IsEqual(d1, d2); - public static bool operator !=(EntityDecorator d1, IEntityWrapper d2) => !EntityWrapperEquality.IsEqual(d1, d2); + public static bool operator !=(EntityWrapper d1, IEntityWrapper d2) => !EntityWrapperEquality.IsEqual(d1, d2); public bool Equals(IEntityWrapper other) => EntityWrapperEquality.IsEqual(this, other); diff --git a/ToSic.Eav.Core/Data/Entities/EntityWrapper.Obsolete.cs b/ToSic.Eav.Core/Data/Entities/EntityWrapper.Obsolete.cs index 1c2ae4631..4c232051a 100644 --- a/ToSic.Eav.Core/Data/Entities/EntityWrapper.Obsolete.cs +++ b/ToSic.Eav.Core/Data/Entities/EntityWrapper.Obsolete.cs @@ -5,7 +5,7 @@ // Old stuff for compatibility with DNN, should not bleed into Oqtane namespace ToSic.Eav.Data { - public partial class EntityDecorator + public partial class EntityWrapper { [PrivateApi] diff --git a/ToSic.Eav.Core/Data/Entities/EntityWrapper.cs b/ToSic.Eav.Core/Data/Entities/EntityWrapper.cs index de576ee67..b30f0b83c 100644 --- a/ToSic.Eav.Core/Data/Entities/EntityWrapper.cs +++ b/ToSic.Eav.Core/Data/Entities/EntityWrapper.cs @@ -13,7 +13,7 @@ namespace ToSic.Eav.Data /// Everything in the original is passed through invisibly.
/// [PrivateApi("this decorator object is for internal use only, no value in publishing it")] - public abstract partial class EntityDecorator : IEntity, IEntityWrapper + public abstract partial class EntityWrapper : IEntity, IEntityWrapper { public IEntity Entity { get; } @@ -21,17 +21,7 @@ public abstract partial class EntityDecorator : IEntity, IEntityWrapper /// Initialize the object and store the underlying IEntity. /// /// - /// - protected EntityDecorator(IEntity baseEntity, IDecorator decorator) : this(baseEntity) - { - if(decorator != null) Decorators.Add(decorator); - } - - /// - /// Initialize the object and store the underlying IEntity. - /// - /// - protected EntityDecorator(IEntity baseEntity) + protected EntityWrapper(IEntity baseEntity) { Entity = baseEntity; EntityForEqualityCheck = Entity; @@ -42,6 +32,17 @@ protected EntityDecorator(IEntity baseEntity) } } + /// + /// Initialize the object and store the underlying IEntity. - adding an additional decorator + /// + /// + /// Additional wrapper to add + protected EntityWrapper(IEntity baseEntity, IDecorator decorator) : this(baseEntity) + { + if(decorator != null) Decorators.Add(decorator); + } + + #region IEntity Implementation /// diff --git a/ToSic.Eav.Core/Data/EntityBasedTypes/IEntityWrapper.cs b/ToSic.Eav.Core/Data/EntityBasedTypes/IEntityWrapper.cs index ad13c88b8..bab6a86e4 100644 --- a/ToSic.Eav.Core/Data/EntityBasedTypes/IEntityWrapper.cs +++ b/ToSic.Eav.Core/Data/EntityBasedTypes/IEntityWrapper.cs @@ -6,7 +6,7 @@ namespace ToSic.Eav.Data /// A interface to ensure all things that carry an IEntity can be compared based on the Entity they carry. /// [PublicApi] - public interface IEntityWrapper: IHasDecorator + public interface IEntityWrapper: IHasDecorators { /// /// The underlying entity. diff --git a/ToSic.Eav.Core/Data/EntityStack/EntityWithStackNavigation.cs b/ToSic.Eav.Core/Data/EntityStack/EntityWithStackNavigation.cs index 4fc07a786..c198083c3 100644 --- a/ToSic.Eav.Core/Data/EntityStack/EntityWithStackNavigation.cs +++ b/ToSic.Eav.Core/Data/EntityStack/EntityWithStackNavigation.cs @@ -7,7 +7,7 @@ namespace ToSic.Eav.Data /// This is a special IEntity-wrapper which will return Stack-Navigation /// [PrivateApi] - public class EntityWithStackNavigation: EntityDecorator + public class EntityWithStackNavigation: EntityWrapper { public EntityWithStackNavigation(IEntity baseEntity, IPropertyStackLookup parent, string field, int index) : base(baseEntity) {