Table of Contents

Interface ICanWrap<TData>

Namespace
ToSic.Sxc.Data
Assembly
ToSic.Sxc.dll

Marks objects such as custom items or data models, which can receive a specific data-type (entity or typed item) and wrap it.

[InternalApi_DoNotUse_MayChangeWithoutNotice("may change or rename at any time")]
public interface ICanWrap<in TData> : ICanWrapData

Type Parameters

TData

The data type which can be accepted. Must be IEntity or ITypedItem (other types not supported for now).

Remarks

This is more specific than the ICanWrapData, since that is just a marker interface. This one specifies that the object has the necessary Setup() method to receive the data of the expected type.

Typical use is for custom data such as classes inheriting from CustomItem which takes an entity and then provides a strongly typed wrapper around it.

History

  • Introduced in v17.02 under a slightly different name
  • Made visible in the docs for better understanding in v19.01
  • The Setup() method is still internal, as the signature may still change