Interface IMemberGroupService
Defines the MemberGroupService, which provides operations for managing IMemberGroup objects.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IMemberGroupService : IService
Methods
View SourceCreateAsync(IMemberGroup)
Creates a new IMemberGroup object
Declaration
Task<Attempt<IMemberGroup?, MemberGroupOperationStatus>> CreateAsync(IMemberGroup memberGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemberGroup | memberGroup | IMemberGroup to create |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IMemberGroup, MemberGroupOperationStatus>> | An attempt with a status of whether the operation was successful or not, and the created object if it succeeded. |
Delete(IMemberGroup)
Deletes a member group.
Declaration
[Obsolete("Please use the asynchronous counterpart. Scheduled for removal in Umbraco 18.")]
void Delete(IMemberGroup memberGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemberGroup | memberGroup | The IMemberGroup to delete. |
DeleteAsync(Guid)
Deletes a IMemberGroup by removing it and its usages from the db
Declaration
Task<Attempt<IMemberGroup?, MemberGroupOperationStatus>> DeleteAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The key of the IMemberGroup to delete |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IMemberGroup, MemberGroupOperationStatus>> | An attempt with a status of whether the operation was successful or not, and the deleted object if it succeeded. |
GetAll()
Gets all member groups.
Declaration
[Obsolete("Please use the asynchronous counterpart. Scheduled for removal in Umbraco 18.")]
IEnumerable<IMemberGroup> GetAll()
Returns
| Type | Description |
|---|---|
| IEnumerable<IMemberGroup> | An enumerable collection of all IMemberGroup objects. |
GetAllAsync()
Gets all member groups
Declaration
Task<IEnumerable<IMemberGroup>> GetAllAsync()
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<IMemberGroup>> | An enumerable list of IMemberGroup objects. |
GetAsync(Guid)
Get a member group by key.
Declaration
Task<IMemberGroup?> GetAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | System.Guid of the member group to get. |
Returns
| Type | Description |
|---|---|
| Task<IMemberGroup> | A IMemberGroup object. |
GetById(Guid)
Gets a member group by its System.Guid key.
Declaration
[Obsolete("Please use the asynchronous counterpart. Scheduled for removal in Umbraco 18.")]
IMemberGroup? GetById(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The System.Guid key of the member group. |
Returns
| Type | Description |
|---|---|
| IMemberGroup | The IMemberGroup if found; otherwise, |
GetById(int)
Gets a member group by its integer id.
Declaration
[Obsolete("Please use Guid instead of Int id. Scheduled for removal in Umbraco 18.")]
IMemberGroup? GetById(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The integer id of the member group. |
Returns
| Type | Description |
|---|---|
| IMemberGroup | The IMemberGroup if found; otherwise, |
GetByIds(IEnumerable<int>)
Gets multiple member groups by their integer ids.
Declaration
[Obsolete("Please use the asynchronous counterpart. Scheduled for removal in Umbraco 18.")]
IEnumerable<IMemberGroup> GetByIds(IEnumerable<int> ids)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<int> | ids | An enumerable collection of integer ids. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IMemberGroup> | An enumerable collection of IMemberGroup objects. |
GetByIdsAsync(IEnumerable<int>)
Gets a list of member groups with the given ids.
Declaration
Task<IEnumerable<IMemberGroup>> GetByIdsAsync(IEnumerable<int> ids)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<int> | ids | An enumerable list of int ids, to get the member groups by. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<IMemberGroup>> | An enumerable list of IMemberGroup objects. |
GetByName(string?)
Gets a member group by its name.
Declaration
IMemberGroup? GetByName(string? name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the member group. |
Returns
| Type | Description |
|---|---|
| IMemberGroup | The IMemberGroup if found; otherwise, |
GetByNameAsync(string)
Get a member group by name.
Declaration
Task<IMemberGroup?> GetByNameAsync(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the member group to get. |
Returns
| Type | Description |
|---|---|
| Task<IMemberGroup> | A IMemberGroup object. |
Save(IMemberGroup)
Saves a member group.
Declaration
[Obsolete("Please use the respective CreateAsync/UpdateAsync for your save operations. Scheduled for removal in Umbraco 18.")]
void Save(IMemberGroup memberGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemberGroup | memberGroup | The IMemberGroup to save. |
UpdateAsync(IMemberGroup)
Updates IMemberGroup object
Declaration
Task<Attempt<IMemberGroup?, MemberGroupOperationStatus>> UpdateAsync(IMemberGroup memberGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemberGroup | memberGroup | IMemberGroup to create |
Returns
| Type | Description |
|---|---|
| Task<Attempt<IMemberGroup, MemberGroupOperationStatus>> | An attempt with a status of whether the operation was successful or not, and the object. |