Class ServiceContext
Represents the Umbraco Service context, which provides access to all services.
Inheritance
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public class ServiceContext
Constructors
View SourceServiceContext(Lazy<IPublicAccessService>?, Lazy<IDomainService>?, Lazy<IAuditService>?, Lazy<ILocalizedTextService>?, Lazy<ITagService>?, Lazy<IContentService>?, Lazy<IUserService>?, Lazy<IMemberService>?, Lazy<IMediaService>?, Lazy<IContentTypeService>?, Lazy<IMediaTypeService>?, Lazy<IDataTypeService>?, Lazy<IFileService>?, Lazy<ILocalizationService>?, Lazy<IPackagingService>?, Lazy<IServerRegistrationService>?, Lazy<IEntityService>?, Lazy<IRelationService>?, Lazy<IMemberTypeService>?, Lazy<IMemberGroupService>?, Lazy<INotificationService>?, Lazy<IExternalLoginWithKeyService>?, Lazy<IRedirectUrlService>?, Lazy<IConsentService>?, Lazy<IKeyValueService>?, Lazy<IContentTypeBaseServiceProvider>?, Lazy<IWebhookService>?)
Initializes a new instance of the ServiceContext class with lazy services.
Declaration
public ServiceContext(Lazy<IPublicAccessService>? publicAccessService, Lazy<IDomainService>? domainService, Lazy<IAuditService>? auditService, Lazy<ILocalizedTextService>? localizedTextService, Lazy<ITagService>? tagService, Lazy<IContentService>? contentService, Lazy<IUserService>? userService, Lazy<IMemberService>? memberService, Lazy<IMediaService>? mediaService, Lazy<IContentTypeService>? contentTypeService, Lazy<IMediaTypeService>? mediaTypeService, Lazy<IDataTypeService>? dataTypeService, Lazy<IFileService>? fileService, Lazy<ILocalizationService>? localizationService, Lazy<IPackagingService>? packagingService, Lazy<IServerRegistrationService>? serverRegistrationService, Lazy<IEntityService>? entityService, Lazy<IRelationService>? relationService, Lazy<IMemberTypeService>? memberTypeService, Lazy<IMemberGroupService>? memberGroupService, Lazy<INotificationService>? notificationService, Lazy<IExternalLoginWithKeyService>? externalLoginService, Lazy<IRedirectUrlService>? redirectUrlService, Lazy<IConsentService>? consentService, Lazy<IKeyValueService>? keyValueService, Lazy<IContentTypeBaseServiceProvider>? contentTypeBaseServiceProvider, Lazy<IWebhookService>? webhookService)
Parameters
| Type | Name | Description |
|---|---|---|
| Lazy<IPublicAccessService> | publicAccessService | |
| Lazy<IDomainService> | domainService | |
| Lazy<IAuditService> | auditService | |
| Lazy<ILocalizedTextService> | localizedTextService | |
| Lazy<ITagService> | tagService | |
| Lazy<IContentService> | contentService | |
| Lazy<IUserService> | userService | |
| Lazy<IMemberService> | memberService | |
| Lazy<IMediaService> | mediaService | |
| Lazy<IContentTypeService> | contentTypeService | |
| Lazy<IMediaTypeService> | mediaTypeService | |
| Lazy<IDataTypeService> | dataTypeService | |
| Lazy<IFileService> | fileService | |
| Lazy<ILocalizationService> | localizationService | |
| Lazy<IPackagingService> | packagingService | |
| Lazy<IServerRegistrationService> | serverRegistrationService | |
| Lazy<IEntityService> | entityService | |
| Lazy<IRelationService> | relationService | |
| Lazy<IMemberTypeService> | memberTypeService | |
| Lazy<IMemberGroupService> | memberGroupService | |
| Lazy<INotificationService> | notificationService | |
| Lazy<IExternalLoginWithKeyService> | externalLoginService | |
| Lazy<IRedirectUrlService> | redirectUrlService | |
| Lazy<IConsentService> | consentService | |
| Lazy<IKeyValueService> | keyValueService | |
| Lazy<IContentTypeBaseServiceProvider> | contentTypeBaseServiceProvider | |
| Lazy<IWebhookService> | webhookService |
Properties
View SourceAuditService
Gets the IAuditService
Declaration
public IAuditService? AuditService { get; }
Property Value
| Type | Description |
|---|---|
| IAuditService |
ConsentService
Gets the ConsentService.
Declaration
public IConsentService? ConsentService { get; }
Property Value
| Type | Description |
|---|---|
| IConsentService |
ContentService
Gets the IContentService
Declaration
public IContentService? ContentService { get; }
Property Value
| Type | Description |
|---|---|
| IContentService |
ContentTypeBaseServices
Gets the ContentTypeServiceBaseFactory.
Declaration
public IContentTypeBaseServiceProvider? ContentTypeBaseServices { get; }
Property Value
| Type | Description |
|---|---|
| IContentTypeBaseServiceProvider |
ContentTypeService
Gets the IContentTypeService
Declaration
public IContentTypeService? ContentTypeService { get; }
Property Value
| Type | Description |
|---|---|
| IContentTypeService |
DataTypeService
Gets the IDataTypeService
Declaration
public IDataTypeService? DataTypeService { get; }
Property Value
| Type | Description |
|---|---|
| IDataTypeService |
DomainService
Gets the IDomainService
Declaration
public IDomainService? DomainService { get; }
Property Value
| Type | Description |
|---|---|
| IDomainService |
EntityService
Gets the IEntityService
Declaration
public IEntityService? EntityService { get; }
Property Value
| Type | Description |
|---|---|
| IEntityService |
ExternalLoginService
Gets the ExternalLoginService.
Declaration
public IExternalLoginWithKeyService? ExternalLoginService { get; }
Property Value
| Type | Description |
|---|---|
| IExternalLoginWithKeyService |
FileService
Gets the IFileService
Declaration
public IFileService? FileService { get; }
Property Value
| Type | Description |
|---|---|
| IFileService |
KeyValueService
Gets the KeyValueService.
Declaration
public IKeyValueService? KeyValueService { get; }
Property Value
| Type | Description |
|---|---|
| IKeyValueService |
LocalizationService
Gets the ILocalizationService
Declaration
public ILocalizationService? LocalizationService { get; }
Property Value
| Type | Description |
|---|---|
| ILocalizationService |
MediaService
Gets the IMediaService
Declaration
public IMediaService? MediaService { get; }
Property Value
| Type | Description |
|---|---|
| IMediaService |
MediaTypeService
Gets the IMediaTypeService
Declaration
public IMediaTypeService? MediaTypeService { get; }
Property Value
| Type | Description |
|---|---|
| IMediaTypeService |
MemberGroupService
Gets the MemberGroupService
Declaration
public IMemberGroupService? MemberGroupService { get; }
Property Value
| Type | Description |
|---|---|
| IMemberGroupService |
MemberService
Gets the MemberService
Declaration
public IMemberService? MemberService { get; }
Property Value
| Type | Description |
|---|---|
| IMemberService |
MemberTypeService
Gets the MemberTypeService
Declaration
public IMemberTypeService? MemberTypeService { get; }
Property Value
| Type | Description |
|---|---|
| IMemberTypeService |
NotificationService
Gets the INotificationService
Declaration
public INotificationService? NotificationService { get; }
Property Value
| Type | Description |
|---|---|
| INotificationService |
PackagingService
Gets the PackagingService
Declaration
public IPackagingService? PackagingService { get; }
Property Value
| Type | Description |
|---|---|
| IPackagingService |
PublicAccessService
Gets the IPublicAccessService
Declaration
public IPublicAccessService? PublicAccessService { get; }
Property Value
| Type | Description |
|---|---|
| IPublicAccessService |
RedirectUrlService
Gets the RedirectUrlService.
Declaration
public IRedirectUrlService? RedirectUrlService { get; }
Property Value
| Type | Description |
|---|---|
| IRedirectUrlService |
RelationService
Gets the IRelationService
Declaration
public IRelationService? RelationService { get; }
Property Value
| Type | Description |
|---|---|
| IRelationService |
ServerRegistrationService
Gets the ServerRegistrationService
Declaration
public IServerRegistrationService? ServerRegistrationService { get; }
Property Value
| Type | Description |
|---|---|
| IServerRegistrationService |
TagService
Gets the ITagService
Declaration
public ITagService? TagService { get; }
Property Value
| Type | Description |
|---|---|
| ITagService |
TextService
Gets the ILocalizedTextService
Declaration
public ILocalizedTextService? TextService { get; }
Property Value
| Type | Description |
|---|---|
| ILocalizedTextService |
UserService
Gets the UserService
Declaration
public IUserService? UserService { get; }
Property Value
| Type | Description |
|---|---|
| IUserService |
WebhookService
Gets the WebhookService.
Declaration
public IWebhookService? WebhookService { get; }
Property Value
| Type | Description |
|---|---|
| IWebhookService |
Methods
View SourceCreatePartial(IContentService?, IMediaService?, IContentTypeService?, IMediaTypeService?, IDataTypeService?, IFileService?, ILocalizationService?, IPackagingService?, IEntityService?, IRelationService?, IMemberGroupService?, IMemberTypeService?, IMemberService?, IUserService?, ITagService?, INotificationService?, ILocalizedTextService?, IAuditService?, IDomainService?, IPublicAccessService?, IExternalLoginWithKeyService?, IServerRegistrationService?, IRedirectUrlService?, IConsentService?, IKeyValueService?, IContentTypeBaseServiceProvider?, IWebhookService?)
Creates a partial service context with only some services (for tests).
Declaration
public static ServiceContext CreatePartial(IContentService? contentService = null, IMediaService? mediaService = null, IContentTypeService? contentTypeService = null, IMediaTypeService? mediaTypeService = null, IDataTypeService? dataTypeService = null, IFileService? fileService = null, ILocalizationService? localizationService = null, IPackagingService? packagingService = null, IEntityService? entityService = null, IRelationService? relationService = null, IMemberGroupService? memberGroupService = null, IMemberTypeService? memberTypeService = null, IMemberService? memberService = null, IUserService? userService = null, ITagService? tagService = null, INotificationService? notificationService = null, ILocalizedTextService? localizedTextService = null, IAuditService? auditService = null, IDomainService? domainService = null, IPublicAccessService? publicAccessService = null, IExternalLoginWithKeyService? externalLoginService = null, IServerRegistrationService? serverRegistrationService = null, IRedirectUrlService? redirectUrlService = null, IConsentService? consentService = null, IKeyValueService? keyValueService = null, IContentTypeBaseServiceProvider? contentTypeBaseServiceProvider = null, IWebhookService? webhookService = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IContentService | contentService | |
| IMediaService | mediaService | |
| IContentTypeService | contentTypeService | |
| IMediaTypeService | mediaTypeService | |
| IDataTypeService | dataTypeService | |
| IFileService | fileService | |
| ILocalizationService | localizationService | |
| IPackagingService | packagingService | |
| IEntityService | entityService | |
| IRelationService | relationService | |
| IMemberGroupService | memberGroupService | |
| IMemberTypeService | memberTypeService | |
| IMemberService | memberService | |
| IUserService | userService | |
| ITagService | tagService | |
| INotificationService | notificationService | |
| ILocalizedTextService | localizedTextService | |
| IAuditService | auditService | |
| IDomainService | domainService | |
| IPublicAccessService | publicAccessService | |
| IExternalLoginWithKeyService | externalLoginService | |
| IServerRegistrationService | serverRegistrationService | |
| IRedirectUrlService | redirectUrlService | |
| IConsentService | consentService | |
| IKeyValueService | keyValueService | |
| IContentTypeBaseServiceProvider | contentTypeBaseServiceProvider | |
| IWebhookService | webhookService |
Returns
| Type | Description |
|---|---|
| ServiceContext |
Remarks
Using a true constructor for this confuses DI containers.