Interface IMemberEditingService
Defines the member editing service, which provides operations for creating, updating, and deleting members.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IMemberEditingService
Methods
View SourceCreateAsync(MemberCreateModel, IUser)
Creates a new member.
Declaration
Task<Attempt<MemberCreateResult, MemberEditingStatus>> CreateAsync(MemberCreateModel createModel, IUser user)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberCreateModel | createModel | The MemberCreateModel containing the member data. |
| IUser | user | The user performing the create operation. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<MemberCreateResult, MemberEditingStatus>> | A task that represents the asynchronous operation. The task result contains an Attempt<TResult, TStatus> with the creation result and status. |
DeleteAsync(Guid, Guid)
Deletes a member.
Declaration
Task<Attempt<IMember?, MemberEditingStatus>> DeleteAsync(Guid key, Guid userKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique key of the member to delete. |
| Guid | userKey | The unique key of the user performing the delete operation. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IMember, MemberEditingStatus>> | A task that represents the asynchronous operation. The task result contains an Attempt<TResult, TStatus> with the deleted member and status. |
GetAsync(Guid)
Gets a member by its unique key.
Declaration
Task<IMember?> GetAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique key of the member. |
Returns
| Type | Description |
|---|---|
| Task<IMember> | A task that represents the asynchronous operation. The task result contains the IMember if found; otherwise, null. |
UpdateAsync(Guid, MemberUpdateModel, IUser)
Updates an existing member.
Declaration
Task<Attempt<MemberUpdateResult, MemberEditingStatus>> UpdateAsync(Guid key, MemberUpdateModel updateModel, IUser user)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique key of the member to update. |
| MemberUpdateModel | updateModel | The MemberUpdateModel containing the updated member data. |
| IUser | user | The user performing the update operation. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<MemberUpdateResult, MemberEditingStatus>> | A task that represents the asynchronous operation. The task result contains an Attempt<TResult, TStatus> with the update result and status. |
ValidateCreateAsync(MemberCreateModel)
Validates a member create model before creation.
Declaration
Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> ValidateCreateAsync(MemberCreateModel createModel)
Parameters
| Type | Name | Description |
|---|---|---|
| MemberCreateModel | createModel | The MemberCreateModel to validate. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> | A task that represents the asynchronous operation. The task result contains an Attempt<TResult, TStatus> with validation results and operation status. |
ValidateUpdateAsync(Guid, MemberUpdateModel)
Validates a member update model before updating.
Declaration
Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> ValidateUpdateAsync(Guid key, MemberUpdateModel updateModel)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The unique key of the member to update. |
| MemberUpdateModel | updateModel | The MemberUpdateModel to validate. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<ContentValidationResult, ContentEditingOperationStatus>> | A task that represents the asynchronous operation. The task result contains an Attempt<TResult, TStatus> with validation results and operation status. |