Taskling.SqlServer.Tokens.CriticalSections.CriticalSectionState.GetQueueString C# (CSharp) Метод

GetQueueString() публичный Метод

public GetQueueString ( ) : string
Результат string
        public string GetQueueString()
        {
            var sb = new StringBuilder();
            foreach (var queueItem in _queue)
            {
                if (queueItem.Index > 1)
                    sb.Append("|");

                sb.Append(queueItem.Index + "," + queueItem.TaskExecutionId);
            }

            return sb.ToString();
        }

Usage Example

        private async Task UpdateCriticalSectionStateAsync(int taskDefinitionId, CriticalSectionState csState, CriticalSectionType criticalSectionType, SqlCommand command)
        {
            command.Parameters.Clear();

            if (criticalSectionType == CriticalSectionType.User)
            {
                command.CommandText = TokensQueryBuilder.SetUserCriticalSectionStateQuery;
            }
            else
            {
                command.CommandText = TokensQueryBuilder.SetClientCriticalSectionStateQuery;
            }

            command.Parameters.Add("@TaskDefinitionId", SqlDbType.Int).Value  = taskDefinitionId;
            command.Parameters.Add("@CsStatus", SqlDbType.Int).Value          = csState.IsGranted ? 1 : 0;
            command.Parameters.Add("@CsTaskExecutionId", SqlDbType.Int).Value = csState.GrantedToExecution;
            command.Parameters.Add("@CsQueue", SqlDbType.VarChar, 8000).Value = csState.GetQueueString();
            await command.ExecuteNonQueryAsync().ConfigureAwait(false);
        }
All Usage Examples Of Taskling.SqlServer.Tokens.CriticalSections.CriticalSectionState::GetQueueString