Interface IMemberGroupRepository
Represents a repository for IMemberGroup entities.
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface IMemberGroupRepository : IReadWriteQueryRepository<int, IMemberGroup>, IReadRepository<int, IMemberGroup>, IWriteRepository<IMemberGroup>, IQueryRepository<IMemberGroup>, IRepository
Methods
View SourceAssignRoles(int[], string[])
Assigns roles to the specified members.
Declaration
void AssignRoles(int[] memberIds, string[] roleNames)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | memberIds | The identifiers of the members. |
| string[] | roleNames | The names of the roles to assign. |
CreateIfNotExists(string)
Creates the new member group if it doesn't already exist
Declaration
IMemberGroup? CreateIfNotExists(string roleName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | roleName |
Returns
| Type | Description |
|---|---|
| IMemberGroup |
DissociateRoles(int[], string[])
Dissociates roles from the specified members.
Declaration
void DissociateRoles(int[] memberIds, string[] roleNames)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | memberIds | The identifiers of the members. |
| string[] | roleNames | The names of the roles to dissociate. |
Get(Guid)
Gets a member group by it's uniqueId
Declaration
IMemberGroup? Get(Guid uniqueId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | uniqueId |
Returns
| Type | Description |
|---|---|
| IMemberGroup |
GetByName(string?)
Gets a member group by it's name
Declaration
IMemberGroup? GetByName(string? name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| IMemberGroup |
GetMemberGroupsForMember(int)
Returns the member groups for a given member
Declaration
IEnumerable<IMemberGroup> GetMemberGroupsForMember(int memberId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | memberId |
Returns
| Type | Description |
|---|---|
| IEnumerable<IMemberGroup> |
GetMemberGroupsForMember(string?)
Returns the member groups for a given member
Declaration
IEnumerable<IMemberGroup> GetMemberGroupsForMember(string? username)
Parameters
| Type | Name | Description |
|---|---|---|
| string | username |
Returns
| Type | Description |
|---|---|
| IEnumerable<IMemberGroup> |
ReplaceRoles(int[], string[])
Replaces the roles for the specified members.
Declaration
void ReplaceRoles(int[] memberIds, string[] roleNames)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | memberIds | The identifiers of the members. |
| string[] | roleNames | The names of the roles to assign. |