Interface IModelFactory
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
itemTSourcesettingsWrapDataSettings
Returns
- TCustom
Type Parameters
TCustomTSource
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
sourceTSourceThe source object containing data used to set up the wrapper model. Cannot be null.
Returns
- TModel
An instance of
TModelinitialized with the specified source object.
Type Parameters
TSourceThe type of the source object used to initialize the wrapper model.
TModelThe 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.