Represents the MemberService.
InheritanceSystem.Object
Namespace: Umbraco.Cms.Core.Services Assembly: Umbraco.Core.dll Syntaxpublic class MemberService : RepositoryService, IMemberService, IMembershipMemberService, IMembershipMemberService<IMember>, IMembershipRoleService<IMember>, IContentServiceBase<IMember>, IContentServiceBase, IService
Constructors View Source MemberService(ICoreScopeProvider, ILoggerFactory, IEventMessagesFactory, IMemberGroupService, IMemberRepository, IMemberTypeRepository, IMemberGroupRepository, IAuditRepository, Lazy<IIdKeyMap>) Declaration
public MemberService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IMemberGroupService memberGroupService, IMemberRepository memberRepository, IMemberTypeRepository memberTypeRepository, IMemberGroupRepository memberGroupRepository, IAuditRepository auditRepository, Lazy<IIdKeyMap> idKeyMap)
Parameters Methods View Source AddRole(String) Declaration
public void AddRole(string roleName)
Parameters Type Name Description System.String roleName View Source AssignRole(Int32, String) Declaration
public void AssignRole(int memberId, string roleName)
Parameters Type Name Description System.Int32 memberId System.String roleName View Source AssignRole(String, String) Declaration
public void AssignRole(string username, string roleName)
Parameters Type Name Description System.String username System.String roleName View Source AssignRoles(Int32[], String[]) Declaration
public void AssignRoles(int[] memberIds, string[] roleNames)
Parameters Type Name Description System.Int32[] memberIds System.String[] roleNames View Source AssignRoles(String[], String[]) Declaration
public void AssignRoles(string[] usernames, string[] roleNames)
Parameters Type Name Description System.String[] usernames System.String[] roleNames View Source CheckDataIntegrity(ContentDataIntegrityReportOptions) Declaration
public ContentDataIntegrityReport CheckDataIntegrity(ContentDataIntegrityReportOptions options)
Parameters Returns View Source Count(String)
Gets the count of Members by an optional MemberType alias
Declarationpublic int Count(string memberTypeAlias = null)
Parameters Type Name Description System.String memberTypeAlias
Optional alias for the MemberType when counting number of Members
Returns Type Description System.Int32System.Int32 with number of Members
View Source CreateMember(String, String, String, String)Creates an IMember object without persisting it
Declarationpublic IMember CreateMember(string username, string email, string name, string memberTypeAlias)
Parameters Type Name Description System.String username
Username of the Member to create
System.String emailEmail of the Member to create
System.String nameName of the Member to create
System.String memberTypeAliasAlias of the MemberType the Member should be based on
Returns View Source CreateMember(String, String, String, IMemberType)Creates an IMember object without persisting it
Declarationpublic IMember CreateMember(string username, string email, string name, IMemberType memberType)
Parameters Type Name Description System.String username
Username of the Member to create
System.String emailEmail of the Member to create
System.String nameName of the Member to create
IMemberType memberTypeMemberType the Member should be based on
Returns View Source CreateMemberWithIdentity(String, String, String) Declarationpublic IMember CreateMemberWithIdentity(string username, string email, string memberTypeAlias)
Parameters Type Name Description System.String username System.String email System.String memberTypeAlias Returns View Source CreateMemberWithIdentity(String, String, String, Boolean) Declaration
public IMember CreateMemberWithIdentity(string username, string email, string memberTypeAlias, bool isApproved)
Parameters Type Name Description System.String username System.String email System.String memberTypeAlias System.Boolean isApproved Returns View Source CreateMemberWithIdentity(String, String, String, String) Declaration
public IMember CreateMemberWithIdentity(string username, string email, string name, string memberTypeAlias)
Parameters Type Name Description System.String username System.String email System.String name System.String memberTypeAlias Returns View Source CreateMemberWithIdentity(String, String, String, String, Boolean) Declaration
public IMember CreateMemberWithIdentity(string username, string email, string name, string memberTypeAlias, bool isApproved)
Parameters Type Name Description System.String username System.String email System.String name System.String memberTypeAlias System.Boolean isApproved Returns View Source CreateMemberWithIdentity(String, String, String, String, String, Boolean)
Creates and persists a Member.
Declarationpublic IMember CreateMemberWithIdentity(string username, string email, string name, string passwordValue, string memberTypeAlias, bool isApproved = true)
Parameters Type Name Description System.String username
Username of the Member to create.
System.String emailEmail of the Member to create.
System.String nameName of the Member to create.
System.String passwordValuePassword value of the Member to create.
System.String memberTypeAliasAlias of the MemberType the Member should be based on.
System.Boolean isApprovedOptional IsApproved of the Member to create.
Returns View Source CreateMemberWithIdentity(String, String, String, IMemberType) Declarationpublic IMember CreateMemberWithIdentity(string username, string email, string name, IMemberType memberType)
Parameters Type Name Description System.String username System.String email System.String name IMemberType memberType Returns View Source CreateMemberWithIdentity(String, String, String, IMemberType, Boolean)
Creates and persists a Member
Declarationpublic IMember CreateMemberWithIdentity(string username, string email, string name, IMemberType memberType, bool isApproved)
Parameters Type Name Description System.String username
Username of the Member to create
System.String emailEmail of the Member to create
System.String nameName of the Member to create
IMemberType memberTypeMemberType the Member should be based on
System.Boolean isApprovedIs the member approved
Returns View Source CreateMemberWithIdentity(String, String, IMemberType) Declarationpublic IMember CreateMemberWithIdentity(string username, string email, IMemberType memberType)
Parameters Type Name Description System.String username System.String email IMemberType memberType Returns View Source CreateMemberWithIdentity(String, String, IMemberType, Boolean)
Creates and persists a Member
Declarationpublic IMember CreateMemberWithIdentity(string username, string email, IMemberType memberType, bool isApproved)
Parameters Type Name Description System.String username
Username of the Member to create
System.String emailEmail of the Member to create
IMemberType memberTypeMemberType the Member should be based on
System.Boolean isApprovedIs the member approved.
Returns View Source Delete(IMember)Deletes an IMembershipUser
Declarationpublic void Delete(IMember member)
Parameters Type Name Description IMember member View Source Delete(IMember, Int32)
Permanently deletes an IMember object
Declarationpublic Attempt<OperationResult> Delete(IMember member, int userId = -1)
Parameters Type Name Description IMember member
The IMember to delete
System.Int32 userIdId of the User deleting the Member
Returns View Source DeleteMembersOfType(Int32)Delete Members of the specified MemberType id
Declarationpublic void DeleteMembersOfType(int memberTypeId)
Parameters Type Name Description System.Int32 memberTypeId
Id of the MemberType
View Source DeleteRole(String, Boolean) Declarationpublic bool DeleteRole(string roleName, bool throwIfBeingUsed)
Parameters Type Name Description System.String roleName System.Boolean throwIfBeingUsed Returns Type Description System.Boolean View Source DissociateRole(Int32, String) Declaration
public void DissociateRole(int memberId, string roleName)
Parameters Type Name Description System.Int32 memberId System.String roleName View Source DissociateRole(String, String) Declaration
public void DissociateRole(string username, string roleName)
Parameters Type Name Description System.String username System.String roleName View Source DissociateRoles(Int32[], String[]) Declaration
public void DissociateRoles(int[] memberIds, string[] roleNames)
Parameters Type Name Description System.Int32[] memberIds System.String[] roleNames View Source DissociateRoles(String[], String[]) Declaration
public void DissociateRoles(string[] usernames, string[] roleNames)
Parameters Type Name Description System.String[] usernames System.String[] roleNames View Source Exists(Int32)
Checks if a Member with the id exists
Declarationpublic bool Exists(int id)
Parameters Type Name Description System.Int32 id
Id of the Member
Returns Type Description System.BooleanTrue
if the Member exists otherwise False
Checks if a Member with the username exists
Declarationpublic bool Exists(string username)
Parameters Type Name Description System.String username
Username to check
Returns Type Description System.BooleanTrue
if the Member exists otherwise False
Exports a member.
Declarationpublic MemberExportModel ExportMember(Guid key)
Parameters Type Name Description Guid key Returns View Source FilterAsync(MemberFilter, String, Direction, Int32, Int32) Declaration
public async Task<PagedModel<IMember>> FilterAsync(MemberFilter memberFilter, string orderBy = "username", Direction orderDirection = Direction.Ascending, int skip = 0, int take = 100)
Parameters Type Name Description MemberFilter memberFilter System.String orderBy Direction orderDirection System.Int32 skip System.Int32 take Returns View Source FindByEmail(String, Int64, Int32, out Int64, StringPropertyMatchType)
Finds a list of IMember objects by a partial email string
Declarationpublic IEnumerable<IMember> FindByEmail(string emailStringToMatch, long pageIndex, int pageSize, out long totalRecords, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith)
Parameters Type Name Description System.String emailStringToMatch
Partial email string to match
System.Int64 pageIndexCurrent page index
System.Int32 pageSizeSize of the page
System.Int64 totalRecordsTotal number of records found (out)
StringPropertyMatchType matchTypeThe type of match to make as StringPropertyMatchType. Default is StartsWith
Returns Type Description IEnumerable<IMember> View Source FindByUsername(String, Int64, Int32, out Int64, StringPropertyMatchType)Finds a list of IMember objects by a partial username
Declarationpublic IEnumerable<IMember> FindByUsername(string login, long pageIndex, int pageSize, out long totalRecords, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith)
Parameters Type Name Description System.String login
Partial username to match
System.Int64 pageIndexCurrent page index
System.Int32 pageSizeSize of the page
System.Int64 totalRecordsTotal number of records found (out)
StringPropertyMatchType matchTypeThe type of match to make as StringPropertyMatchType. Default is StartsWith
Returns Type Description IEnumerable<IMember> View Source FindMembersByDisplayName(String, Int64, Int32, out Int64, StringPropertyMatchType)Finds Members based on their display name
Declarationpublic IEnumerable<IMember> FindMembersByDisplayName(string displayNameToMatch, long pageIndex, int pageSize, out long totalRecords, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith)
Parameters Type Name Description System.String displayNameToMatch
Display name to match
System.Int64 pageIndexCurrent page index
System.Int32 pageSizeSize of the page
System.Int64 totalRecordsTotal number of records found (out)
StringPropertyMatchType matchTypeThe type of match to make as StringPropertyMatchType. Default is StartsWith
Returns Type Description IEnumerable<IMember> View Source FindMembersInRole(String, String, StringPropertyMatchType) Declarationpublic IEnumerable<IMember> FindMembersInRole(string roleName, string usernameToMatch, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith)
Parameters Returns Type Description IEnumerable<IMember> View Source GetAll(Int64, Int32, out Int64)
Gets a list of paged IMember objects
Declarationpublic IEnumerable<IMember> GetAll(long pageIndex, int pageSize, out long totalRecords)
Parameters Type Name Description System.Int64 pageIndex
Current page index
System.Int32 pageSizeSize of the page
System.Int64 totalRecordsTotal number of records found (out)
Returns Type Description IEnumerable<IMember> View Source GetAll(Int64, Int32, out Int64, String, Direction, Boolean, String, String) Declarationpublic IEnumerable<IMember> GetAll(long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, bool orderBySystemField, string memberTypeAlias, string filter)
Parameters Type Name Description System.Int64 pageIndex System.Int32 pageSize System.Int64 totalRecords System.String orderBy Direction orderDirection System.Boolean orderBySystemField System.String memberTypeAlias System.String filter Returns Type Description IEnumerable<IMember> View Source GetAll(Int64, Int32, out Int64, String, Direction, String, String) Declaration
public IEnumerable<IMember> GetAll(long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, string memberTypeAlias = null, string filter = "")
Parameters Type Name Description System.Int64 pageIndex System.Int32 pageSize System.Int64 totalRecords System.String orderBy Direction orderDirection System.String memberTypeAlias System.String filter Returns Type Description IEnumerable<IMember> View Source GetAllMembers(Int32[])
Gets all Members with the ids specified
Declarationpublic IEnumerable<IMember> GetAllMembers(params int[] ids)
Parameters Type Name Description System.Int32[] ids
Optional list of Member Ids
Returns Type Description IEnumerable<IMember> View Source GetAllRoles()Returns a list of all member roles
Declarationpublic IEnumerable<IMemberGroup> GetAllRoles()
Returns Type Description IEnumerable<IMemberGroup>
A list of member roles
View Source GetAllRoles(Int32)Returns a list of all member roles for a given member ID
Declarationpublic IEnumerable<string> GetAllRoles(int memberId)
Parameters Type Name Description System.Int32 memberId Returns Type Description IEnumerable<System.String>
A list of member roles
View Source GetAllRoles(String) Declarationpublic IEnumerable<string> GetAllRoles(string username)
Parameters Type Name Description System.String username Returns Type Description IEnumerable<System.String> View Source GetAllRolesIds() Declaration
public IEnumerable<int> GetAllRolesIds()
Returns Type Description IEnumerable<System.Int32> View Source GetAllRolesIds(Int32) Declaration
public IEnumerable<int> GetAllRolesIds(int memberId)
Parameters Type Name Description System.Int32 memberId Returns Type Description IEnumerable<System.Int32> View Source GetAllRolesIds(String) Declaration
public IEnumerable<int> GetAllRolesIds(string username)
Parameters Type Name Description System.String username Returns Type Description IEnumerable<System.Int32> View Source GetByEmail(String)
Get an IMember by email. If RequireUniqueEmailForMembers is set to false, then the first member found with the specified email will be returned.
Declarationpublic IMember GetByEmail(string email)
Parameters Type Name Description System.String email
Email to use for retrieval
Returns View Source GetById(Guid)Gets a Member by the unique key
Declarationpublic IMember GetById(Guid id)
Parameters Type Name Description Guid id
Id
Returns View Source GetById(Int32)Gets a Member by its integer id
Declarationpublic IMember GetById(int id)
Parameters Type Name Description System.Int32 id
System.Int32 Id
Returns View Source GetByKey(Guid) Declarationpublic IMember GetByKey(Guid id)
Parameters Type Name Description Guid id Returns View Source GetByKeysAsync(Guid[])
Gets IMember objects by Ids
Declarationpublic Task<IEnumerable<IMember>> GetByKeysAsync(params Guid[] ids)
Parameters Type Name Description Guid[] ids
Ids of the Member to retrieve
Returns View Source GetByProviderKey(Object)Gets an IMember by its provider key
Declarationpublic IMember GetByProviderKey(object id)
Parameters Type Name Description System.Object id
Id to use for retrieval
Returns View Source GetByUsername(String)Get an IMember by username
Declarationpublic IMember GetByUsername(string username)
Parameters Type Name Description System.String username
Username to use for retrieval
Returns View Source GetCount(MemberCountType)Gets the total number of Members based on the count type
Declarationpublic int GetCount(MemberCountType countType)
Parameters Returns Type Description System.Int32
System.Int32 with number of Members for passed in type
View Source GetMembersByEmail(String)Get an list of IMember for all members with the specified email.
Declarationpublic IEnumerable<IMember> GetMembersByEmail(string email)
Parameters Type Name Description System.String email
Email to use for retrieval
Returns Type Description IEnumerable<IMember> View Source GetMembersByGroup(String)Gets all Members within the specified MemberGroup name
Declarationpublic IEnumerable<IMember> GetMembersByGroup(string memberGroupName)
Parameters Type Name Description System.String memberGroupName
Name of the MemberGroup
Returns Type Description IEnumerable<IMember> View Source GetMembersByMemberType(Int32)Gets all Members for the MemberType id
Declarationpublic IEnumerable<IMember> GetMembersByMemberType(int memberTypeId)
Parameters Type Name Description System.Int32 memberTypeId
Id of the MemberType
Returns Type Description IEnumerable<IMember> View Source GetMembersByMemberType(String)Gets all Members for the specified MemberType alias
Declarationpublic IEnumerable<IMember> GetMembersByMemberType(string memberTypeAlias)
Parameters Type Name Description System.String memberTypeAlias
Alias of the MemberType
Returns Type Description IEnumerable<IMember> View Source GetMembersByPropertyValue(String, DateTime, ValuePropertyMatchType)Gets a list of Members based on a property search
Declarationpublic IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, DateTime value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact)
Parameters Returns Type Description System.Nullable<IEnumerable<IMember>> View Source GetMembersByPropertyValue(String, Boolean)
Gets a list of Members based on a property search
Declarationpublic IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, bool value)
Parameters Type Name Description System.String propertyTypeAlias
Alias of the PropertyType to search for
System.Boolean valueSystem.Boolean Value to match
Returns Type Description System.Nullable<IEnumerable<IMember>> View Source GetMembersByPropertyValue(String, Int32, ValuePropertyMatchType)Gets a list of Members based on a property search
Declarationpublic IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, int value, ValuePropertyMatchType matchType = ValuePropertyMatchType.Exact)
Parameters Returns Type Description System.Nullable<IEnumerable<IMember>> View Source GetMembersByPropertyValue(String, String, StringPropertyMatchType)
Gets a list of Members based on a property search
Declarationpublic IEnumerable<IMember>? GetMembersByPropertyValue(string propertyTypeAlias, string value, StringPropertyMatchType matchType = StringPropertyMatchType.Exact)
Parameters Returns Type Description System.Nullable<IEnumerable<IMember>> View Source GetMembersInRole(String) Declaration
public IEnumerable<IMember> GetMembersInRole(string roleName)
Parameters Type Name Description System.String roleName Returns Type Description IEnumerable<IMember> View Source ReplaceRoles(Int32[], String[]) Declaration
public void ReplaceRoles(int[] memberIds, string[] roleNames)
Parameters Type Name Description System.Int32[] memberIds System.String[] roleNames View Source ReplaceRoles(String[], String[]) Declaration
public void ReplaceRoles(string[] usernames, string[] roleNames)
Parameters Type Name Description System.String[] usernames System.String[] roleNames View Source Save(IEnumerable<IMember>) Declaration
public void Save(IEnumerable<IMember> members)
Parameters Type Name Description IEnumerable<IMember> members View Source Save(IEnumerable<IMember>, Int32)
Saves a list of IMember objects
Declarationpublic Attempt<OperationResult> Save(IEnumerable<IMember> members, int userId = -1)
Parameters Type Name Description IEnumerable<IMember> members
Collection of IMember to save
System.Int32 userIdId of the User saving the Members
Returns View Source Save(IMember) Declarationpublic void Save(IMember member)
Parameters Type Name Description IMember member View Source Save(IMember, Int32)
Saves a single IMember object
Declarationpublic Attempt<OperationResult> Save(IMember member, int userId = -1)
Parameters Type Name Description IMember member System.Int32 userId
Id of the User saving the Member
Returns View Source Save(IMember, PublishNotificationSaveOptions, Int32) Declarationpublic Attempt<OperationResult> Save(IMember member, PublishNotificationSaveOptions publishNotificationSaveOptions, int userId = -1)
Parameters Returns View Source SetLastLogin(String, DateTime) Declaration
public void SetLastLogin(string username, DateTime date)
Parameters Type Name Description System.String username DateTime date Explicit Interface Implementations View Source IMembershipMemberService<IMember>.CreateWithIdentity(String, String, String, String)
Creates and persists a new IMember
DeclarationIMember IMembershipMemberService<IMember>.CreateWithIdentity(string username, string email, string passwordValue, string memberTypeAlias)
Parameters Type Name Description System.String username
Username of the IMembershipUser to create
System.String emailEmail of the IMembershipUser to create
System.String passwordValueThis value should be the encoded/encrypted/hashed value for the password that will be stored in the database
System.String memberTypeAliasAlias of the Type
Returns View Source IMembershipMemberService<IMember>.CreateWithIdentity(String, String, String, String, Boolean)Creates and persists a new IMember
DeclarationIMember IMembershipMemberService<IMember>.CreateWithIdentity(string username, string email, string passwordValue, string memberTypeAlias, bool isApproved)
Parameters Type Name Description System.String username
Username of the IMembershipUser to create
System.String emailEmail of the IMembershipUser to create
System.String passwordValueThis value should be the encoded/encrypted/hashed value for the password that will be stored in the database
System.String memberTypeAliasAlias of the Type
System.Boolean isApproved ReturnsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4