Exemplo n.º 1
0
        /// <summary>
        /// SetAccessFailedCountAsync
        /// </summary>
        /// <param name="userGuid"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        /// <exception cref="DatabaseException"></exception>
        public async Task SetAccessFailedCountAsync <TUser>(string userGuid, long count) where TUser : IdenityUser, new()
        {
            TransactionContext transactionContext = await _database.BeginTransactionAsync <TUser>(IsolationLevel.ReadCommitted).ConfigureAwait(false);

            try
            {
                await _userBiz.SetAccessFailedCountAsync <TUser>(userGuid, count, transactionContext).ConfigureAwait(false);

                await _database.CommitAsync(transactionContext).ConfigureAwait(false);
            }
            catch
            {
                await _database.RollbackAsync(transactionContext).ConfigureAwait(false);

                throw;
            }
        }