Exemplo n.º 1
0
        /// <summary>
        ///     Creates a single task
        /// </summary>
        /// <param name="payload"> The task payload </param>
        /// <returns> The task id </returns>
        public async Task <string> Create(TaskPayload payload)
        {
            TaskIdCollection result = await Create(new TaskPayloadCollection(payload));

            if (result.Success)
            {
                return(result.GetIds().FirstOrDefault());
            }

            throw new IronSharpException(string.Format("Task was not queued successfully: {0}", result.Message));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a single task
        /// </summary>
        /// <param name="payload"> The task payload </param>
        /// <returns> The task id </returns>
        public string Create(TaskPayload payload)
        {
            TaskIdCollection result = Create(new TaskPayloadCollection(payload));

            if (result.Success)
            {
                return result.GetIds().FirstOrDefault();
            }

            throw new IronSharpException(string.Format("Task was not queued successfully: {0}", result.Message));
        }
 public TaskPayloadCollection(TaskPayload payload)
 {
     Tasks.Add(payload);
 }
Exemplo n.º 4
0
 public TaskPayloadCollection(TaskPayload payload)
 {
     Tasks.Add(payload);
 }