Interface IMembershipMemberService<T>
Defines part of the UserService/MemberService, which is specific to methods used by the membership provider. The generic type is restricted to IMembershipUser. The implementation of this interface uses either IMember for the MemberService or IUser for the UserService.
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IMembershipMemberService<T> : IService where T : class, IMembershipUser
Type Parameters
Name | Description |
---|---|
T |
Remarks
Idea is to have this as an isolated interface so that it can be easily 'replaced' in the membership provider implementation.
Methods
View SourceCreateWithIdentity(String, String, String, String)
Creates and persists a new IMembershipUser
Declaration
T CreateWithIdentity(string username, string email, string passwordValue, string memberTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | Username of the IMembershipUser to create |
System.String | Email of the IMembershipUser to create |
|
System.String | passwordValue | This value should be the encoded/encrypted/hashed value for the password that will be stored in the database |
System.String | memberTypeAlias | Alias of the Type |
Returns
Type | Description |
---|---|
T | IMembershipUser |
Remarks
An IMembershipUser can be of type IMember or IUser
CreateWithIdentity(String, String, String, String, Boolean)
Creates and persists a new IMembershipUser
Declaration
T 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 | Email of the IMembershipUser to create |
|
System.String | passwordValue | This value should be the encoded/encrypted/hashed value for the password that will be stored in the database |
System.String | memberTypeAlias | Alias of the Type |
System.Boolean | isApproved | IsApproved of the IMembershipUser to create |
Returns
Type | Description |
---|---|
T | IMembershipUser |
Remarks
An IMembershipUser can be of type IMember or IUser
Delete(T)
Deletes an IMembershipUser
Declaration
void Delete(T membershipUser)
Parameters
Type | Name | Description |
---|---|---|
T | membershipUser |
Remarks
An IMembershipUser can be of type IMember or IUser
Exists(String)
Checks if a Member with the username exists
Declaration
bool Exists(string username)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | Username to check |
Returns
Type | Description |
---|---|
System.Boolean |
|
FindByEmail(String, Int64, Int32, out Int64, StringPropertyMatchType)
Finds a list of IMembershipUser objects by a partial email string
Declaration
IEnumerable<T> 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 | pageIndex | Current page index |
System.Int32 | pageSize | Size of the page |
System.Int64 | totalRecords | Total number of records found (out) |
StringPropertyMatchType | matchType | The type of match to make as StringPropertyMatchType. Default is StartsWith |
Returns
Type | Description |
---|---|
IEnumerable<T> |
Remarks
An IMembershipUser can be of type IMember or IUser
FindByUsername(String, Int64, Int32, out Int64, StringPropertyMatchType)
Finds a list of IMembershipUser objects by a partial username
Declaration
IEnumerable<T> 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 | pageIndex | Current page index |
System.Int32 | pageSize | Size of the page |
System.Int64 | totalRecords | Total number of records found (out) |
StringPropertyMatchType | matchType | The type of match to make as StringPropertyMatchType. Default is StartsWith |
Returns
Type | Description |
---|---|
IEnumerable<T> |
Remarks
An IMembershipUser can be of type IMember or IUser
GetAll(Int64, Int32, out Int64)
Gets a list of paged IMembershipUser objects
Declaration
IEnumerable<T> GetAll(long pageIndex, int pageSize, out long totalRecords)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | pageIndex | Current page index |
System.Int32 | pageSize | Size of the page |
System.Int64 | totalRecords | Total number of records found (out) |
Returns
Type | Description |
---|---|
IEnumerable<T> |
Remarks
An IMembershipUser can be of type IMember or IUser
GetByEmail(String)
Get an IMembershipUser by email
Declaration
T GetByEmail(string email)
Parameters
Type | Name | Description |
---|---|---|
System.String | Email to use for retrieval |
Returns
Type | Description |
---|---|
T | IMembershipUser |
Remarks
An IMembershipUser can be of type IMember or IUser
GetByProviderKey(Object)
Gets an IMembershipUser by its provider key
Declaration
T GetByProviderKey(object id)
Parameters
Type | Name | Description |
---|---|---|
System.Object | id | Id to use for retrieval |
Returns
Type | Description |
---|---|
T | IMembershipUser |
Remarks
An IMembershipUser can be of type IMember or IUser
GetByUsername(String)
Get an IMembershipUser by username
Declaration
T GetByUsername(string username)
Parameters
Type | Name | Description |
---|---|---|
System.String | username | Username to use for retrieval |
Returns
Type | Description |
---|---|
T | IMembershipUser |
Remarks
An IMembershipUser can be of type IMember or IUser
GetCount(MemberCountType)
Gets the total number of Members or Users based on the count type
Declaration
int GetCount(MemberCountType countType)
Parameters
Type | Name | Description |
---|---|---|
MemberCountType | countType | MemberCountType to count by |
Returns
Type | Description |
---|---|
System.Int32 | System.Int32 with number of Members or Users for passed in type |
Remarks
The way the Online count is done is the same way that it is done in the MS SqlMembershipProvider - We query for any members that have their last active date within the Membership.UserIsOnlineTimeWindow (which is in minutes). It isn't exact science but that is how MS have made theirs so we'll follow that principal.
Save(T)
Saves an IMembershipUser
Declaration
void Save(T entity)
Parameters
Type | Name | Description |
---|---|---|
T | entity |
Remarks
An IMembershipUser can be of type IMember or IUser
Save(IEnumerable<T>)
Saves a list of IMembershipUser objects
Declaration
void Save(IEnumerable<T> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | entities |
Remarks
An IMembershipUser can be of type IMember or IUser