Esempio n. 1
0
        /// <summary>
        /// Persists a new instance of UserClaim. Returns true on success.
        /// </summary>
        /// <returns></returns>
        public async Task <bool> SaveClaim(IUserClaim userClaim)
        {
            int newId = await dbUserClaims.Create(
                userClaim.SiteId,
                userClaim.UserId,
                userClaim.ClaimType,
                userClaim.ClaimValue);

            userClaim.Id = newId;

            return(newId > -1);
        }
Esempio n. 2
0
        /// <summary>
        /// Persists a new instance of UserClaim. Returns true on success.
        /// </summary>
        /// <returns></returns>
        public async Task <bool> SaveClaim(IUserClaim userClaim, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            int newId = await dbUserClaims.Create(
                userClaim.SiteId,
                userClaim.UserId,
                userClaim.ClaimType,
                userClaim.ClaimValue);

            userClaim.Id = newId;

            return(newId > -1);
        }