Table of Contents

Class UserRoleInfoProvider

Namespace
CMS.Membership
Assembly
CMS.Membership.dll

Class providing UserRoleInfo management.

[ProviderInterface(typeof(IUserRoleInfoProvider))]
public class UserRoleInfoProvider : AbstractInfoProvider<UserRoleInfo, UserRoleInfoProvider>, IInfoProvider, ICustomizableProvider, IBulkOperationProvider, IWebFarmProvider, IInfoValidator<UserRoleInfo>, IInfoByIdProvider<UserRoleInfo>, IInfoByGuidProvider<UserRoleInfo>, IInfoByNameProvider<UserRoleInfo>, IBulkInfoProvider<UserRoleInfo>, IUserRoleInfoProvider, IInfoProvider<UserRoleInfo>
Inheritance
object
UserRoleInfoProvider
Implements
Inherited Members
Extension Methods

Methods

Add(int, int)

Creates UserRoleInfo binding.

public virtual void Add(int userId, int roleId)

Parameters

userId int

User ID.

roleId int

Role ID.

Exceptions

ArgumentException

Thrown when userId or roleId does not identify an existing user or role respectively.

Delete(UserRoleInfo)

Deletes the info object from the underlying data store.

public override void Delete(UserRoleInfo info)

Parameters

info UserRoleInfo

Info object to be deleted.

Exceptions

ArgumentNullException

Thrown when info is null.

DeleteUserRoleInfoInternal(UserRoleInfo, UserInfo, RoleInfo)

Deletes specified userRole.

protected virtual void DeleteUserRoleInfoInternal(UserRoleInfo infoObj, UserInfo userInfo, RoleInfo roleInfo)

Parameters

infoObj UserRoleInfo

UserRole object

userInfo UserInfo

User which will be removed from role

roleInfo RoleInfo

Role from which will be the user removed

Get(int, int)

Gets an instance of the UserRoleInfo binding structure.

public virtual UserRoleInfo Get(int userId, int roleId)

Parameters

userId int

User ID.

roleId int

Role ID.

Returns

UserRoleInfo

Returns an instance of UserRoleInfo corresponding to given identifiers or null.

GetAsync(int, int, CancellationToken?)

Asynchronously gets an instance of the UserRoleInfo binding structure.

public virtual Task<UserRoleInfo> GetAsync(int userId, int roleId, CancellationToken? cancellationToken = null)

Parameters

userId int

User ID.

roleId int

Role ID.

cancellationToken CancellationToken?

The cancellation instruction.

Returns

Task<UserRoleInfo>

Returns a task returning either an instance of UserRoleInfo corresponding to given identifiers or null.

Remove(int, int)

Deletes UserRoleInfo binding.

public virtual void Remove(int userId, int roleId)

Parameters

userId int

User ID.

roleId int

Role ID.

SetInfo(UserRoleInfo)

Inserts or updates the object to the database.

protected override void SetInfo(UserRoleInfo info)

Parameters

info UserRoleInfo

Object to insert or update.