Class PublishedExternalMember
A lightweight IPublishedMember representation for external-only members that are not backed by the content system.
Inheritance
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Core.dll
Syntax
public sealed class PublishedExternalMember : IPublishedMember, IPublishedContent, IPublishedElement
Remarks
External members have no content type, no content properties, no tree position, and no template. This implementation provides sensible defaults for those members so that member picker property values resolve correctly in templates.
If the external member has ProfileData (a JSON string),
each top-level key in the JSON object is exposed as an IPublishedProperty.
This allows @Model.Member.Value("department") to work identically for both
content members (where "department" is a content property) and external members
(where "department" is a key in the profile data JSON).
Constructors
View SourcePublishedExternalMember(ExternalMemberIdentity)
Initializes a new instance of the PublishedExternalMember class.
Declaration
public PublishedExternalMember(ExternalMemberIdentity identity)
Parameters
| Type | Name | Description |
|---|---|---|
| ExternalMemberIdentity | identity | The external member identity to wrap. |
Properties
View SourceChildren
Gets the children of the content item that are available for the current culture.
Declaration
public IEnumerable<IPublishedContent> Children { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IPublishedContent> |
Comments
Gets the comments associated with the member account.
Declaration
public string? Comments { get; }
Property Value
| Type | Description |
|---|---|
| string |
ContentType
Gets the content type.
Declaration
public IPublishedContentType ContentType { get; }
Property Value
| Type | Description |
|---|---|
| IPublishedContentType |
CreateDate
Gets the date the content item was created.
Declaration
public DateTime CreateDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CreationDate
Gets the date and time when the member account was created.
Declaration
public DateTime CreationDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CreatorId
Gets the identifier of the user who created the content item.
Declaration
public int CreatorId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Cultures
Gets available culture infos.
Declaration
public IReadOnlyDictionary<string, PublishedCultureInfo> Cultures { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, PublishedCultureInfo> |
Remarks
Contains only those culture that are available. For a published content, these are the cultures that are published. For a draft content, those that are 'available' ie have a non-empty content name.
Does not contain the invariant culture.
// TODO?Gets the email address of the member.
Declaration
public string Email { get; }
Property Value
| Type | Description |
|---|---|
| string |
Id
Gets the unique identifier of the content item.
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsApproved
Gets a value indicating whether the member account is approved.
Declaration
public bool IsApproved { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsLockedOut
Gets a value indicating whether the member account is locked out.
Declaration
public bool IsLockedOut { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ItemType
Gets the type of the content item (document, media...).
Declaration
public PublishedItemType ItemType { get; }
Property Value
| Type | Description |
|---|---|
| PublishedItemType |
Key
Gets the unique key of the published element.
Declaration
public Guid Key { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
LastLockoutDate
Gets the date and time when the member account was last locked out.
Declaration
public DateTime? LastLockoutDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
LastLoginDate
Gets the date and time of the member's last login.
Declaration
public DateTime? LastLoginDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
LastPasswordChangedDate
Gets the date and time when the member's password was last changed.
Declaration
public DateTime? LastPasswordChangedDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Level
Gets the tree level of the content item.
Declaration
public int Level { get; }
Property Value
| Type | Description |
|---|---|
| int |
Name
Gets the name of the content item for the current culture.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Parent
Gets the parent of the content item.
Declaration
public IPublishedContent? Parent { get; }
Property Value
| Type | Description |
|---|---|
| IPublishedContent |
Remarks
The parent of root content is null.
Path
Gets the tree path of the content item.
Declaration
public string Path { get; }
Property Value
| Type | Description |
|---|---|
| string |
Properties
Gets the properties of the element.
Declaration
public IEnumerable<IPublishedProperty> Properties { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IPublishedProperty> |
Remarks
Contains one IPublishedProperty for each property defined for the content type, including
inherited properties. Some properties may have no value.
SortOrder
Gets the sort order of the content item.
Declaration
public int SortOrder { get; }
Property Value
| Type | Description |
|---|---|
| int |
TemplateId
Gets the identifier of the template to use to render the content item.
Declaration
public int? TemplateId { get; }
Property Value
| Type | Description |
|---|---|
| int? |
UpdateDate
Gets the date the content item was last updated.
Declaration
public DateTime UpdateDate { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Remarks
For published content items, this is also the date the item was published.
This date is always global to the content item, see CultureDate() for the date each culture was published.
UrlSegment
Gets the URL segment of the content item for the current culture.
Declaration
public string? UrlSegment { get; }
Property Value
| Type | Description |
|---|---|
| string |
UserName
Gets the username of the member.
Declaration
public string UserName { get; }
Property Value
| Type | Description |
|---|---|
| string |
WriterId
Gets the identifier of the user who last updated the content item.
Declaration
public int WriterId { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceGetProperty(string)
Gets a property identified by its alias.
Declaration
public IPublishedProperty? GetProperty(string alias)
Parameters
| Type | Name | Description |
|---|---|---|
| string | alias | The property alias. |
Returns
| Type | Description |
|---|---|
| IPublishedProperty | The property identified by the alias. |
Remarks
If the content type has no property with that alias, including inherited properties, returns null,
otherwise return a property -- that may have no value (ie HasValue is false).
The alias is case-insensitive.
IsDraft(string?)
Gets a value indicating whether the content is draft.
Declaration
public bool IsDraft(string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A content is draft when it is the unpublished version of a content, which may have a published version, or not.
When retrieving documents from cache in non-preview mode, IsDraft is always false, as only published documents are returned. When retrieving in preview mode, IsDraft can either be true (document is not published, or has been edited, and what is returned is the edited version) or false (document is published, and has not been edited, and what is returned is the published version).
IsPublished(string?)
Gets a value indicating whether the content is published.
Declaration
public bool IsPublished(string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A content is published when it has a published version.
When retrieving documents from cache in non-preview mode, IsPublished is always true, as only published documents are returned. When retrieving in draft mode, IsPublished can either be true (document has a published version) or false (document has no published version).
It is therefore possible for both IsDraft and IsPublished to be true at the same time, meaning that the content is the draft version, and a published version exists.