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(Nullable<Lazy<IPublicAccessService>>, Nullable<Lazy<IDomainService>>, Nullable<Lazy<IAuditService>>, Nullable<Lazy<ILocalizedTextService>>, Nullable<Lazy<ITagService>>, Nullable<Lazy<IContentService>>, Nullable<Lazy<IUserService>>, Nullable<Lazy<IMemberService>>, Nullable<Lazy<IMediaService>>, Nullable<Lazy<IContentTypeService>>, Nullable<Lazy<IMediaTypeService>>, Nullable<Lazy<IDataTypeService>>, Nullable<Lazy<IFileService>>, Nullable<Lazy<ILocalizationService>>, Nullable<Lazy<IPackagingService>>, Nullable<Lazy<IServerRegistrationService>>, Nullable<Lazy<IEntityService>>, Nullable<Lazy<IRelationService>>, Nullable<Lazy<IMacroService>>, Nullable<Lazy<IMemberTypeService>>, Nullable<Lazy<IMemberGroupService>>, Nullable<Lazy<INotificationService>>, Nullable<Lazy<IExternalLoginService>>, Nullable<Lazy<IRedirectUrlService>>, Nullable<Lazy<IConsentService>>, Nullable<Lazy<IKeyValueService>>, Nullable<Lazy<IContentTypeBaseServiceProvider>>)
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<IMacroService>? macroService, Lazy<IMemberTypeService>? memberTypeService, Lazy<IMemberGroupService>? memberGroupService, Lazy<INotificationService>? notificationService, Lazy<IExternalLoginService>? externalLoginService, Lazy<IRedirectUrlService>? redirectUrlService, Lazy<IConsentService>? consentService, Lazy<IKeyValueService>? keyValueService, Lazy<IContentTypeBaseServiceProvider>? contentTypeBaseServiceProvider)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<Lazy<IPublicAccessService>> | publicAccessService | |
System.Nullable<Lazy<IDomainService>> | domainService | |
System.Nullable<Lazy<IAuditService>> | auditService | |
System.Nullable<Lazy<ILocalizedTextService>> | localizedTextService | |
System.Nullable<Lazy<ITagService>> | tagService | |
System.Nullable<Lazy<IContentService>> | contentService | |
System.Nullable<Lazy<IUserService>> | userService | |
System.Nullable<Lazy<IMemberService>> | memberService | |
System.Nullable<Lazy<IMediaService>> | mediaService | |
System.Nullable<Lazy<IContentTypeService>> | contentTypeService | |
System.Nullable<Lazy<IMediaTypeService>> | mediaTypeService | |
System.Nullable<Lazy<IDataTypeService>> | dataTypeService | |
System.Nullable<Lazy<IFileService>> | fileService | |
System.Nullable<Lazy<ILocalizationService>> | localizationService | |
System.Nullable<Lazy<IPackagingService>> | packagingService | |
System.Nullable<Lazy<IServerRegistrationService>> | serverRegistrationService | |
System.Nullable<Lazy<IEntityService>> | entityService | |
System.Nullable<Lazy<IRelationService>> | relationService | |
System.Nullable<Lazy<IMacroService>> | macroService | |
System.Nullable<Lazy<IMemberTypeService>> | memberTypeService | |
System.Nullable<Lazy<IMemberGroupService>> | memberGroupService | |
System.Nullable<Lazy<INotificationService>> | notificationService | |
System.Nullable<Lazy<IExternalLoginService>> | externalLoginService | |
System.Nullable<Lazy<IRedirectUrlService>> | redirectUrlService | |
System.Nullable<Lazy<IConsentService>> | consentService | |
System.Nullable<Lazy<IKeyValueService>> | keyValueService | |
System.Nullable<Lazy<IContentTypeBaseServiceProvider>> | contentTypeBaseServiceProvider |
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 IExternalLoginService ExternalLoginService { get; }
Property Value
Type | Description |
---|---|
IExternalLoginService |
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 |
MacroService
Gets the IMacroService
Declaration
public IMacroService MacroService { get; }
Property Value
Type | Description |
---|---|
IMacroService |
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 |
Methods
View SourceCreatePartial(IContentService, IMediaService, IContentTypeService, IMediaTypeService, IDataTypeService, IFileService, ILocalizationService, IPackagingService, IEntityService, IRelationService, IMemberGroupService, IMemberTypeService, IMemberService, IUserService, ITagService, INotificationService, ILocalizedTextService, IAuditService, IDomainService, IMacroService, IPublicAccessService, IExternalLoginService, IServerRegistrationService, IRedirectUrlService, IConsentService, IKeyValueService, IContentTypeBaseServiceProvider)
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, IMacroService macroService = null, IPublicAccessService publicAccessService = null, IExternalLoginService externalLoginService = null, IServerRegistrationService serverRegistrationService = null, IRedirectUrlService redirectUrlService = null, IConsentService consentService = null, IKeyValueService keyValueService = null, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider = 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 | |
IMacroService | macroService | |
IPublicAccessService | publicAccessService | |
IExternalLoginService | externalLoginService | |
IServerRegistrationService | serverRegistrationService | |
IRedirectUrlService | redirectUrlService | |
IConsentService | consentService | |
IKeyValueService | keyValueService | |
IContentTypeBaseServiceProvider | contentTypeBaseServiceProvider |
Returns
Type | Description |
---|---|
ServiceContext |
Remarks
Using a true constructor for this confuses DI containers.