November Happy Hour will be moved to Thursday December 5th.

Class ContentTypeModelScanner

Creates a ContentTypeModelRegister and feeds it the ContentTypeModels stored in the IScannedTypeRepository.

Inheritance
System.Object
ContentTypeModelScanner
Namespace: EPiServer.DataAbstraction.RuntimeModel.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
[ServiceConfiguration]
public class ContentTypeModelScanner : Object, IContentTypeModelScanner

Constructors

ContentTypeModelScanner(ITypeScannerLookup, ContentTypeModelRegister, ContentModelValidator, ContentTypeModelRepository, IContentTypeModelAssigner, ContentDataInterceptorHandler, ContentDataInterceptor, IEnumerable<IContentTypeModelFilter>, IEnumerable<ContentScannerExtension>, IAvailableModelSettingsRepository, IContentTypeModelScannerEventsRaiser)

Initializes a new instance of the ContentTypeModelScanner class.

Declaration
public ContentTypeModelScanner(ITypeScannerLookup typeScannerLookup, ContentTypeModelRegister typeModelRegister, ContentModelValidator modelValidator, ContentTypeModelRepository contentTypeModelRepository, IContentTypeModelAssigner contentTypeModelAssigner, ContentDataInterceptorHandler modelTypeInterceptorHandler, ContentDataInterceptor modelTypeInterceptor, IEnumerable<IContentTypeModelFilter> filters, IEnumerable<ContentScannerExtension> registerExtensions, IAvailableModelSettingsRepository availableContentTypeService, IContentTypeModelScannerEventsRaiser contentTypeModelScannerEvents)
Parameters
Type Name Description
ITypeScannerLookup typeScannerLookup
ContentTypeModelRegister typeModelRegister
ContentModelValidator modelValidator
ContentTypeModelRepository contentTypeModelRepository
IContentTypeModelAssigner contentTypeModelAssigner
ContentDataInterceptorHandler modelTypeInterceptorHandler
ContentDataInterceptor modelTypeInterceptor
System.Collections.Generic.IEnumerable<IContentTypeModelFilter> filters
System.Collections.Generic.IEnumerable<ContentScannerExtension> registerExtensions
IAvailableModelSettingsRepository availableContentTypeService
IContentTypeModelScannerEventsRaiser contentTypeModelScannerEvents

Properties

ContentTypes

Gets content types in the system.

Declaration
public virtual IEnumerable<Type> ContentTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

DeleteUnusedContentTypes

Gets a value indicating whether unused content types should be deleted

Declaration
protected virtual bool DeleteUnusedContentTypes { get; }
Property Value
Type Description
System.Boolean

true if unused content types should be deleted; otherwise, false.

Remarks

returns true.

IgnoredTypes

Gets the types that are ignored during scanning.

Declaration
public virtual IEnumerable<Type> IgnoredTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

The ignored types.

Remarks

By default this is system types like PageData and BlockData

RunSynchronously

If methods should run without parallellism

Declaration
public bool RunSynchronously { get; set; }
Property Value
Type Description
System.Boolean

Methods

AddModel(Type)

Adds a model with the specified type.

Declaration
public virtual void AddModel(Type type)
Parameters
Type Name Description
System.Type type

The type.

AssignAvailableTypes(ContentTypeModel)

Register settings for which types that should be available under a specific type.

Declaration
protected virtual void AssignAvailableTypes(ContentTypeModel typeModel)
Parameters
Type Name Description
ContentTypeModel typeModel

The type model.

AssignValuesToModel(ContentTypeModel)

Creates a type model and adds it to the collection of types.

Declaration
protected virtual void AssignValuesToModel(ContentTypeModel typeModel)
Parameters
Type Name Description
ContentTypeModel typeModel

The type model.

AssignValuesToProperties(ContentTypeModel)

Assigns values to modelType.

Declaration
protected virtual void AssignValuesToProperties(ContentTypeModel modelType)
Parameters
Type Name Description
ContentTypeModel modelType

Type of the model.

CreateModel(Type)

Creates a model.

Declaration
protected virtual ContentTypeModel CreateModel(Type type)
Parameters
Type Name Description
System.Type type

The type to create the model from.

Returns
Type Description
ContentTypeModel

EagerCompileProxies()

Creates a task that compiles proxies for all types that has automatic getters/setters.

Declaration
protected virtual void EagerCompileProxies()

GetProperties(ContentTypeModel)

Gets properties on the modelType.

Declaration
public virtual IEnumerable<PropertyInfo> GetProperties(ContentTypeModel modelType)
Parameters
Type Name Description
ContentTypeModel modelType

The model to get properties from.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo>

Register(ContentTypeModel)

Registers the specified type model.

Declaration
protected virtual void Register(ContentTypeModel typeModel)
Parameters
Type Name Description
ContentTypeModel typeModel

The type model.

RegisterDependentModels(ContentTypeModel)

Declaration
protected virtual void RegisterDependentModels(ContentTypeModel typeModel)
Parameters
Type Name Description
ContentTypeModel typeModel

RegisterModels()

Registers the models with the repositories.

Declaration
public virtual IList<Task> RegisterModels()
Returns
Type Description
System.Collections.Generic.IList<System.Threading.Tasks.Task>

A list of started tasks.

Remarks

The registration is complete when all returned task are completed.

Sync(Boolean)

Creates ContentTypeModels from the relevant types stored in the IScannedTypeRepository and passes them to the ContentTypeModelRegister.

Declaration
public virtual IList<Task> Sync(bool commitChanges)
Parameters
Type Name Description
System.Boolean commitChanges

if set to true then stores in repository.

Returns
Type Description
System.Collections.Generic.IList<System.Threading.Tasks.Task>

A list of started tasks.

Remarks

The registration is complete when all returned task are completed.

Implements

Extension Methods