Class CompositionExtensions
Provides extension methods to the Composition class.
Inheritance
Namespace: Umbraco.Core
Assembly: Umbraco.Core.dll
Syntax
public static class CompositionExtensions
Methods
View SourceCacheRefreshers(Composition)
Gets the cache refreshers collection builder.
Declaration
public static CacheRefresherCollectionBuilder CacheRefreshers(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
CacheRefresherCollectionBuilder |
Components(Composition)
Gets the components collection builder.
Declaration
public static ComponentCollectionBuilder Components(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition |
Returns
Type | Description |
---|---|
ComponentCollectionBuilder |
DataEditors(Composition)
Gets the data editor collection builder.
Declaration
public static DataEditorCollectionBuilder DataEditors(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
DataEditorCollectionBuilder |
DataValueReferenceFactories(Composition)
Gets the data value reference factory collection builder.
Declaration
public static DataValueReferenceFactoryCollectionBuilder DataValueReferenceFactories(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
DataValueReferenceFactoryCollectionBuilder |
ManifestFilters(Composition)
Gets the manifest filter collection builder.
Declaration
public static ManifestFilterCollectionBuilder ManifestFilters(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
ManifestFilterCollectionBuilder |
MapDefinitions(Composition)
Gets the map definitions collection builder.
Declaration
public static MapDefinitionCollectionBuilder MapDefinitions(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
MapDefinitionCollectionBuilder |
Mappers(Composition)
Gets the mappers collection builder.
Declaration
public static MapperCollectionBuilder Mappers(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
MapperCollectionBuilder |
PropertyValueConverters(Composition)
Gets the property value converters collection builder.
Declaration
public static PropertyValueConverterCollectionBuilder PropertyValueConverters(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
PropertyValueConverterCollectionBuilder |
RegisterEssentials(Composition, ILogger, IProfiler, IProfilingLogger, IMainDom, AppCaches, IUmbracoDatabaseFactory, TypeLoader, IRuntimeState)
Registers essential services.
Declaration
public static void RegisterEssentials(this Composition composition, ILogger logger, IProfiler profiler, IProfilingLogger profilingLogger, IMainDom mainDom, AppCaches appCaches, IUmbracoDatabaseFactory databaseFactory, TypeLoader typeLoader, IRuntimeState state)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | |
ILogger | logger | |
IProfiler | profiler | |
IProfilingLogger | profilingLogger | |
IMainDom | mainDom | |
AppCaches | appCaches | |
IUmbracoDatabaseFactory | databaseFactory | |
TypeLoader | typeLoader | |
IRuntimeState | state |
RegisterFileSystem<TFileSystem>(Composition)
Registers a filesystem.
Declaration
public static void RegisterFileSystem<TFileSystem>(this Composition composition)
where TFileSystem : FileSystemWrapper
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
TFileSystem | The type of the filesystem. |
RegisterFileSystem<TFileSystem, TImplementing>(Composition)
Registers a filesystem.
Declaration
public static void RegisterFileSystem<TFileSystem, TImplementing>(this Composition composition)
where TFileSystem : class where TImplementing : FileSystemWrapper, TFileSystem
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
TFileSystem | The type of the filesystem. |
TImplementing | The implementing type. |
RegisterUnique<TService>(Composition)
Registers a unique service as its own implementation.
Declaration
public static void RegisterUnique<TService>(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition |
Type Parameters
Name | Description |
---|---|
TService |
RegisterUnique<TService>(Composition, TService)
Registers a unique service with an implementing instance.
Declaration
public static void RegisterUnique<TService>(this Composition composition, TService instance)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | |
TService | instance |
Type Parameters
Name | Description |
---|---|
TService |
RegisterUnique<TService, TImplementing>(Composition)
Registers a unique service with an implementation type.
Declaration
public static void RegisterUnique<TService, TImplementing>(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition |
Type Parameters
Name | Description |
---|---|
TService | |
TImplementing |
RegisterUniqueFor<TService, TTarget, TImplementing>(Composition)
Registers a unique service with an implementation type, for a target.
Declaration
public static void RegisterUniqueFor<TService, TTarget, TImplementing>(this Composition composition)
where TService : class
Parameters
Type | Name | Description |
---|---|---|
Composition | composition |
Type Parameters
Name | Description |
---|---|
TService | |
TTarget | |
TImplementing |
SetCultureDictionaryFactory(Composition, Func<IFactory, ICultureDictionaryFactory>)
Sets the culture dictionary factory.
Declaration
public static void SetCultureDictionaryFactory(this Composition composition, Func<IFactory, ICultureDictionaryFactory> factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
System.Func<IFactory, ICultureDictionaryFactory> | factory | A function creating a culture dictionary factory. |
SetCultureDictionaryFactory(Composition, ICultureDictionaryFactory)
Sets the culture dictionary factory.
Declaration
public static void SetCultureDictionaryFactory(this Composition composition, ICultureDictionaryFactory factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
ICultureDictionaryFactory | factory | A factory. |
SetCultureDictionaryFactory<T>(Composition)
Sets the culture dictionary factory.
Declaration
public static void SetCultureDictionaryFactory<T>(this Composition composition)
where T : ICultureDictionaryFactory
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
T | The type of the factory. |
SetDatabaseServerMessengerOptions(Composition, Func<IFactory, DatabaseServerMessengerOptions>)
Sets the database server messenger options.
Declaration
public static void SetDatabaseServerMessengerOptions(this Composition composition, Func<IFactory, DatabaseServerMessengerOptions> factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
System.Func<IFactory, DatabaseServerMessengerOptions> | factory | A function creating the options. |
Remarks
Use DatabaseServerRegistrarAndMessengerComposer.GetDefaultOptions to get the options that Umbraco would use by default.
SetDatabaseServerMessengerOptions(Composition, DatabaseServerMessengerOptions)
Sets the database server messenger options.
Declaration
public static void SetDatabaseServerMessengerOptions(this Composition composition, DatabaseServerMessengerOptions options)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
DatabaseServerMessengerOptions | options | Options. |
Remarks
Use DatabaseServerRegistrarAndMessengerComposer.GetDefaultOptions to get the options that Umbraco would use by default.
SetLogViewer(Composition, Func<IFactory, ILogViewer>)
Sets the log viewer.
Declaration
public static void SetLogViewer(this Composition composition, Func<IFactory, ILogViewer> factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
System.Func<IFactory, ILogViewer> | factory | A function creating a log viewer. |
SetLogViewer(Composition, ILogViewer)
Sets the log viewer.
Declaration
public static void SetLogViewer(this Composition composition, ILogViewer viewer)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | A composition. |
ILogViewer | viewer |
SetLogViewer<T>(Composition)
Sets the log viewer.
Declaration
public static void SetLogViewer<T>(this Composition composition)
where T : ILogViewer
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
T | The type of the log viewer. |
SetMediaFileSystem(Composition, Func<IFactory, IFileSystem>)
Sets the underlying media filesystem.
Declaration
public static void SetMediaFileSystem(this Composition composition, Func<IFactory, IFileSystem> filesystemFactory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | A composition. |
System.Func<IFactory, IFileSystem> | filesystemFactory | A filesystem factory. |
SetMediaFileSystem(Composition, Func<IFileSystem>)
Sets the underlying media filesystem.
Declaration
public static void SetMediaFileSystem(this Composition composition, Func<IFileSystem> filesystemFactory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | A composition. |
System.Func<IFileSystem> | filesystemFactory | A filesystem factory. |
SetPublishedContentModelFactory(Composition, Func<IFactory, IPublishedModelFactory>)
Sets the published content model factory.
Declaration
public static void SetPublishedContentModelFactory(this Composition composition, Func<IFactory, IPublishedModelFactory> factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
System.Func<IFactory, IPublishedModelFactory> | factory | A function creating a published content model factory. |
SetPublishedContentModelFactory(Composition, IPublishedModelFactory)
Sets the published content model factory.
Declaration
public static void SetPublishedContentModelFactory(this Composition composition, IPublishedModelFactory factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
IPublishedModelFactory | factory | A published content model factory. |
SetPublishedContentModelFactory<T>(Composition)
Sets the published content model factory.
Declaration
public static void SetPublishedContentModelFactory<T>(this Composition composition)
where T : IPublishedModelFactory
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
T | The type of the factory. |
SetServerMessenger(Composition, Func<IFactory, IServerMessenger>)
Sets the server messenger.
Declaration
public static void SetServerMessenger(this Composition composition, Func<IFactory, IServerMessenger> factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
System.Func<IFactory, IServerMessenger> | factory | A function creating a server messenger. |
SetServerMessenger(Composition, IServerMessenger)
Sets the server messenger.
Declaration
public static void SetServerMessenger(this Composition composition, IServerMessenger registrar)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
IServerMessenger | registrar | A server messenger. |
SetServerMessenger<T>(Composition)
Sets the server messenger.
Declaration
public static void SetServerMessenger<T>(this Composition composition)
where T : IServerMessenger
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
T | The type of the server registrar. |
SetServerRegistrar(Composition, Func<IFactory, IServerRegistrar>)
Sets the server registrar.
Declaration
public static void SetServerRegistrar(this Composition composition, Func<IFactory, IServerRegistrar> factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
System.Func<IFactory, IServerRegistrar> | factory | A function creating a server registrar. |
SetServerRegistrar(Composition, IServerRegistrar)
Sets the server registrar.
Declaration
public static void SetServerRegistrar(this Composition composition, IServerRegistrar registrar)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
IServerRegistrar | registrar | A server registrar. |
SetServerRegistrar<T>(Composition)
Sets the server registrar.
Declaration
public static void SetServerRegistrar<T>(this Composition composition)
where T : IServerRegistrar
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
T | The type of the server registrar. |
SetShortStringHelper(Composition, Func<IFactory, IShortStringHelper>)
Sets the short string helper.
Declaration
public static void SetShortStringHelper(this Composition composition, Func<IFactory, IShortStringHelper> factory)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
System.Func<IFactory, IShortStringHelper> | factory | A function creating a short string helper. |
SetShortStringHelper(Composition, IShortStringHelper)
Sets the short string helper.
Declaration
public static void SetShortStringHelper(this Composition composition, IShortStringHelper helper)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | A composition. |
IShortStringHelper | helper | A short string helper. |
SetShortStringHelper<T>(Composition)
Sets the short string helper.
Declaration
public static void SetShortStringHelper<T>(this Composition composition)
where T : IShortStringHelper
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Type Parameters
Name | Description |
---|---|
T | The type of the short string helper. |
UrlSegmentProviders(Composition)
Gets the URL segment providers collection builder.
Declaration
public static UrlSegmentProviderCollectionBuilder UrlSegmentProviders(this Composition composition)
Parameters
Type | Name | Description |
---|---|---|
Composition | composition | The composition. |
Returns
Type | Description |
---|---|
UrlSegmentProviderCollectionBuilder |