Table of Contents

Interface IModelFactory

Namespace
ToSic.Eav.Models.Factory
Assembly
ToSic.Eav.Data.dll

WIP - nothing done yet, just as a reminder. Goal is that some wrappers require a factory, and these should be marked as such, so that a simple wrapper helper can detect and warn about this.

[InternalApi_DoNotUse_MayChangeWithoutNotice]
public interface IModelFactory
Extension Methods

Methods

AsCustomFrom<TCustom, TSource>(TSource?, WrapDataSettings?)

TCustom? AsCustomFrom<TCustom, TSource>(TSource? item, WrapDataSettings? settings = null) where TCustom : class, IDataWrapper

Parameters

item TSource
settings WrapDataSettings

Returns

TCustom

Type Parameters

TCustom
TSource

Create<TSource, TModel>(TSource?)

Creates a new instance of the specified wrapper model type and initializes it using the provided source object.

TModel? Create<TSource, TModel>(TSource? source) where TModel : IModelSetup<TSource>

Parameters

source TSource

The source object containing data used to set up the wrapper model. Cannot be null.

Returns

TModel

An instance of TModel initialized with the specified source object.

Type Parameters

TSource

The type of the source object used to initialize the wrapper model.

TModel

The type of the wrapper model to create. Must implement IModelSetup<TSource>.

Remarks

The created model is set up using the IModelSetup<TSource> interface, which allows custom initialization logic based on the source object.