Exemplo n.º 1
0
        /// <summary>
        ///		Wraps the object to ether an TaskT or an ValueTaskT
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static ContextObjectPromise ToPromise(this ContextObject data)
        {
#if ValueTask
            return(new ContextObjectPromise(data));
#else
            return(Promise.FromResult(data));
#endif
        }
Exemplo n.º 2
0
        /// <summary>
        ///		Wraps the object to ether an TaskT or an ValueTaskT
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static StringPromise ToPromise(this string data)
        {
#if ValueTask
            return(new StringPromise(data));
#else
            return(Promise.FromResult(data));
#endif
        }
Exemplo n.º 3
0
        /// <summary>
        ///		Wraps the object to ether an TaskT or an ValueTaskT
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static ItemExecutionPromise ToPromise(this IEnumerable <DocumentItemExecution> data)
        {
#if ValueTask
            return(new ItemExecutionPromise(data));
#else
            return(Promise.FromResult(data));
#endif
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a value task that has completed successfully with the specified result.
 /// </summary>
 public static SystemTasks.ValueTask <TResult> FromResult <TResult>(TResult result) =>
 SystemValueTask.FromResult(result);