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 IMembership
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 IMembership
Declaration
T CreateWithIdentity(string username, string email, string passwordValue, string memberTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
System. |
username | Username of the IMembership |
System. |
Email of the IMembership |
|
System. |
passwordValue | This value should be the encoded/encrypted/hashed value for the password that will be stored in the database |
System. |
memberTypeAlias | Alias of the Type |
Returns
Type | Description |
---|---|
T | IMembership |
Remarks
An IMembership
CreateWithIdentity(String, String, String, String, Boolean)
Creates and persists a new IMembership
Declaration
T CreateWithIdentity(string username, string email, string passwordValue, string memberTypeAlias, bool isApproved)
Parameters
Type | Name | Description |
---|---|---|
System. |
username | Username of the IMembership |
System. |
Email of the IMembership |
|
System. |
passwordValue | This value should be the encoded/encrypted/hashed value for the password that will be stored in the database |
System. |
memberTypeAlias | Alias of the Type |
System. |
isApproved | IsApproved of the IMembership |
Returns
Type | Description |
---|---|
T | IMembership |
Remarks
An IMembership
Delete(T)
Deletes an IMembership
Declaration
void Delete(T membershipUser)
Parameters
Remarks
An IMembership
Exists(String)
Checks if a Member with the username exists
Declaration
bool Exists(string username)
Parameters
Type | Name | Description |
---|---|---|
System. |
username | Username to check |
Returns
Type | Description |
---|---|
System. |
|
FindByEmail(String, Int64, Int32, out Int64, StringPropertyMatchType)
Finds a list of IMembership
Declaration
IEnumerable<T> FindByEmail(string emailStringToMatch, long pageIndex, int pageSize, out long totalRecords, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith)
Parameters
Type | Name | Description |
---|---|---|
System. |
emailStringToMatch | Partial email string to match |
System. |
pageIndex | Current page index |
System. |
pageSize | Size of the page |
System. |
totalRecords | Total number of records found (out) |
String |
matchType | The type of match to make as String |
Returns
Type | Description |
---|---|
IEnumerable<T> |
Remarks
An IMembership
FindByUsername(String, Int64, Int32, out Int64, StringPropertyMatchType)
Finds a list of IMembership
Declaration
IEnumerable<T> FindByUsername(string login, long pageIndex, int pageSize, out long totalRecords, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith)
Parameters
Type | Name | Description |
---|---|---|
System. |
login | Partial username to match |
System. |
pageIndex | Current page index |
System. |
pageSize | Size of the page |
System. |
totalRecords | Total number of records found (out) |
String |
matchType | The type of match to make as String |
Returns
Type | Description |
---|---|
IEnumerable<T> |
Remarks
An IMembership
GetAll(Int64, Int32, out Int64)
Gets a list of paged IMembership
Declaration
IEnumerable<T> GetAll(long pageIndex, int pageSize, out long totalRecords)
Parameters
Type | Name | Description |
---|---|---|
System. |
pageIndex | Current page index |
System. |
pageSize | Size of the page |
System. |
totalRecords | Total number of records found (out) |
Returns
Type | Description |
---|---|
IEnumerable<T> |
Remarks
An IMembership
GetByEmail(String)
Get an IMembership
Declaration
T GetByEmail(string email)
Parameters
Type | Name | Description |
---|---|---|
System. |
Email to use for retrieval |
Returns
Type | Description |
---|---|
T | IMembership |
Remarks
An IMembership
GetByProviderKey(Object)
Gets an IMembership
Declaration
T GetByProviderKey(object id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | Id to use for retrieval |
Returns
Type | Description |
---|---|
T | IMembership |
Remarks
An IMembership
GetByUsername(String)
Get an IMembership
Declaration
T GetByUsername(string username)
Parameters
Type | Name | Description |
---|---|---|
System. |
username | Username to use for retrieval |
Returns
Type | Description |
---|---|
T | IMembership |
Remarks
An IMembership
GetCount(MemberCountType)
Gets the total number of Members or Users based on the count type
Declaration
int GetCount(MemberCountType countType)
Parameters
Type | Name | Description |
---|---|---|
Member |
countType | Member |
Returns
Type | Description |
---|---|
System. |
System. |
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 IMembership
Declaration
void Save(T entity)
Parameters
Remarks
An IMembership
Save(IEnumerable<T>)
Saves a list of IMembership
Declaration
void Save(IEnumerable<T> entities)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | entities |
Remarks
An IMembership