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
-
objectUserRoleInfoProvider
- Implements
- Inherited Members
-
AbstractInfoProvider<UserRoleInfo, UserRoleInfoProvider, ObjectQuery<UserRoleInfo>>.GetObjectQuery()
- Extension Methods
Methods
Add(int, int)
Creates UserRoleInfo binding.
public virtual void Add(int userId, int roleId)
Parameters
userId
intUser ID.
roleId
intRole ID.
Exceptions
- ArgumentException
Thrown when
userId
orroleId
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
UserRoleInfoInfo 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
UserRoleInfoUserRole object
userInfo
UserInfoUser which will be removed from role
roleInfo
RoleInfoRole 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
intUser ID.
roleId
intRole 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
intUser ID.
roleId
intRole 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
intUser ID.
roleId
intRole ID.
SetInfo(UserRoleInfo)
Inserts or updates the object to the database.
protected override void SetInfo(UserRoleInfo info)
Parameters
info
UserRoleInfoObject to insert or update.