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<IMemberTypeService>>, Nullable<Lazy<IMemberGroupService>>, Nullable<Lazy<INotificationService>>, Nullable<Lazy<IExternalLoginWithKeyService>>, Nullable<Lazy<IRedirectUrlService>>, Nullable<Lazy<IConsentService>>, Nullable<Lazy<IKeyValueService>>, Nullable<Lazy<IContentTypeBaseServiceProvider>>, Nullable<Lazy<IWebhookService>>)
Initializes a new instance of the Service
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 |
---|---|---|
System. |
publicAccessService | |
System. |
domainService | |
System. |
auditService | |
System. |
localizedTextService | |
System. |
tagService | |
System. |
contentService | |
System. |
userService | |
System. |
memberService | |
System. |
mediaService | |
System. |
contentTypeService | |
System. |
mediaTypeService | |
System. |
dataTypeService | |
System. |
fileService | |
System. |
localizationService | |
System. |
packagingService | |
System. |
serverRegistrationService | |
System. |
entityService | |
System. |
relationService | |
System. |
memberTypeService | |
System. |
memberGroupService | |
System. |
notificationService | |
System. |
externalLoginService | |
System. |
redirectUrlService | |
System. |
consentService | |
System. |
keyValueService | |
System. |
contentTypeBaseServiceProvider | |
System. |
webhookService |
Properties
View SourceAuditService
Gets the IAudit
Declaration
public IAuditService AuditService { get; }
Property Value
Type | Description |
---|---|
IAudit |
ConsentService
Gets the ConsentService.
Declaration
public IConsentService ConsentService { get; }
Property Value
Type | Description |
---|---|
IConsent |
ContentService
Gets the IContent
Declaration
public IContentService ContentService { get; }
Property Value
Type | Description |
---|---|
IContent |
ContentTypeBaseServices
Gets the ContentTypeServiceBaseFactory.
Declaration
public IContentTypeBaseServiceProvider ContentTypeBaseServices { get; }
Property Value
Type | Description |
---|---|
IContent |
ContentTypeService
Gets the IContent
Declaration
public IContentTypeService ContentTypeService { get; }
Property Value
Type | Description |
---|---|
IContent |
DataTypeService
Gets the IData
Declaration
public IDataTypeService DataTypeService { get; }
Property Value
Type | Description |
---|---|
IData |
DomainService
Gets the IDomain
Declaration
public IDomainService DomainService { get; }
Property Value
Type | Description |
---|---|
IDomain |
EntityService
Gets the IEntity
Declaration
public IEntityService EntityService { get; }
Property Value
Type | Description |
---|---|
IEntity |
ExternalLoginService
Gets the ExternalLoginService.
Declaration
public IExternalLoginWithKeyService ExternalLoginService { get; }
Property Value
Type | Description |
---|---|
IExternal |
FileService
Gets the IFile
Declaration
public IFileService FileService { get; }
Property Value
Type | Description |
---|---|
IFile |
KeyValueService
Gets the KeyValueService.
Declaration
public IKeyValueService KeyValueService { get; }
Property Value
Type | Description |
---|---|
IKey |
LocalizationService
Gets the ILocalization
Declaration
public ILocalizationService LocalizationService { get; }
Property Value
Type | Description |
---|---|
ILocalization |
MediaService
Gets the IMedia
Declaration
public IMediaService MediaService { get; }
Property Value
Type | Description |
---|---|
IMedia |
MediaTypeService
Gets the IMedia
Declaration
public IMediaTypeService MediaTypeService { get; }
Property Value
Type | Description |
---|---|
IMedia |
MemberGroupService
Gets the MemberGroupService
Declaration
public IMemberGroupService MemberGroupService { get; }
Property Value
Type | Description |
---|---|
IMember |
MemberService
Gets the Member
Declaration
public IMemberService MemberService { get; }
Property Value
Type | Description |
---|---|
IMember |
MemberTypeService
Gets the MemberTypeService
Declaration
public IMemberTypeService MemberTypeService { get; }
Property Value
Type | Description |
---|---|
IMember |
NotificationService
Gets the INotification
Declaration
public INotificationService NotificationService { get; }
Property Value
Type | Description |
---|---|
INotification |
PackagingService
Gets the Packaging
Declaration
public IPackagingService PackagingService { get; }
Property Value
Type | Description |
---|---|
IPackaging |
PublicAccessService
Gets the IPublic
Declaration
public IPublicAccessService PublicAccessService { get; }
Property Value
Type | Description |
---|---|
IPublic |
RedirectUrlService
Gets the RedirectUrlService.
Declaration
public IRedirectUrlService RedirectUrlService { get; }
Property Value
Type | Description |
---|---|
IRedirect |
RelationService
Gets the IRelation
Declaration
public IRelationService RelationService { get; }
Property Value
Type | Description |
---|---|
IRelation |
ServerRegistrationService
Gets the Server
Declaration
public IServerRegistrationService ServerRegistrationService { get; }
Property Value
Type | Description |
---|---|
IServer |
TagService
Gets the ITag
Declaration
public ITagService TagService { get; }
Property Value
Type | Description |
---|---|
ITag |
TextService
Gets the ILocalized
Declaration
public ILocalizedTextService TextService { get; }
Property Value
Type | Description |
---|---|
ILocalized |
UserService
Gets the User
Declaration
public IUserService UserService { get; }
Property Value
Type | Description |
---|---|
IUser |
WebhookService
Gets the WebhookService.
Declaration
public IWebhookService WebhookService { get; }
Property Value
Type | Description |
---|---|
IWebhook |
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 |
---|---|---|
IContent |
contentService | |
IMedia |
mediaService | |
IContent |
contentTypeService | |
IMedia |
mediaTypeService | |
IData |
dataTypeService | |
IFile |
fileService | |
ILocalization |
localizationService | |
IPackaging |
packagingService | |
IEntity |
entityService | |
IRelation |
relationService | |
IMember |
memberGroupService | |
IMember |
memberTypeService | |
IMember |
memberService | |
IUser |
userService | |
ITag |
tagService | |
INotification |
notificationService | |
ILocalized |
localizedTextService | |
IAudit |
auditService | |
IDomain |
domainService | |
IPublic |
publicAccessService | |
IExternal |
externalLoginService | |
IServer |
serverRegistrationService | |
IRedirect |
redirectUrlService | |
IConsent |
consentService | |
IKey |
keyValueService | |
IContent |
contentTypeBaseServiceProvider | |
IWebhook |
webhookService |
Returns
Type | Description |
---|---|
Service |
Remarks
Using a true constructor for this confuses DI containers.