Search Results for

    Show / Hide Table of Contents
    View Source

    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 Source

    CreateWithIdentity(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

    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

    View Source

    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

    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

    View Source

    Delete(T)

    Deletes an IMembershipUser

    Declaration
    void Delete(T membershipUser)
    Parameters
    Type Name Description
    T membershipUser

    IMember or IUser to Delete

    Remarks

    An IMembershipUser can be of type IMember or IUser

    View Source

    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

    True if the Member exists otherwise False

    View Source

    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

    View Source

    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

    View Source

    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

    View Source

    GetByEmail(String)

    Get an IMembershipUser by email

    Declaration
    T GetByEmail(string email)
    Parameters
    Type Name Description
    System.String email

    Email to use for retrieval

    Returns
    Type Description
    T IMembershipUser
    Remarks

    An IMembershipUser can be of type IMember or IUser

    View Source

    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

    View Source

    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

    View Source

    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.

    View Source

    Save(T)

    Saves an IMembershipUser

    Declaration
    void Save(T entity)
    Parameters
    Type Name Description
    T entity

    IMember or IUser to Save

    Remarks

    An IMembershipUser can be of type IMember or IUser

    View Source

    Save(T, PublishNotificationSaveOptions)

    Saves an IMembershipUser

    Declaration
    virtual void Save(T entity, PublishNotificationSaveOptions publishNotificationSaveOptions)
    Parameters
    Type Name Description
    T entity

    IMember or IUser to Save

    PublishNotificationSaveOptions publishNotificationSaveOptions

    Enum for deciding which notifications to publish.

    Remarks

    An IMembershipUser can be of type IMember or IUser

    View Source

    Save(IEnumerable<T>)

    Saves a list of IMembershipUser objects

    Declaration
    void Save(IEnumerable<T> entities)
    Parameters
    Type Name Description
    IEnumerable<T> entities

    to save

    Remarks

    An IMembershipUser can be of type IMember or IUser

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • CreateWithIdentity(String, String, String, String)
      • CreateWithIdentity(String, String, String, String, Boolean)
      • Delete(T)
      • Exists(String)
      • FindByEmail(String, Int64, Int32, out Int64, StringPropertyMatchType)
      • FindByUsername(String, Int64, Int32, out Int64, StringPropertyMatchType)
      • GetAll(Int64, Int32, out Int64)
      • GetByEmail(String)
      • GetByProviderKey(Object)
      • GetByUsername(String)
      • GetCount(MemberCountType)
      • Save(T)
      • Save(T, PublishNotificationSaveOptions)
      • Save(IEnumerable<T>)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX