Exemple #1
0
 /// <param name='operations'>
 /// Reference to the ContosoFront.IContosoAPI.
 /// </param>
 public static IList <string> GetAll(this IContosoAPI operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IContosoAPI)s).GetAllAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #2
0
 /// <param name='operations'>
 /// Reference to the ContosoFront.IContosoAPI.
 /// </param>
 /// <param name='key'>
 /// Required.
 /// </param>
 /// <param name='newValue'>
 /// Required.
 /// </param>
 public static object Update(this IContosoAPI operations, string key, string newValue)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IContosoAPI)s).UpdateAsync(key, newValue);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #3
0
        /// <param name='operations'>
        /// Reference to the ContosoFront.IContosoAPI.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <IList <string> > GetAllAsync(this IContosoAPI operations, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <string> > result = await operations.GetAllWithOperationResponseAsync(cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Exemple #4
0
        /// <param name='operations'>
        /// Reference to the ContosoFront.IContosoAPI.
        /// </param>
        /// <param name='key'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <object> DeleteAsync(this IContosoAPI operations, string key, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <object> result = await operations.DeleteWithOperationResponseAsync(key, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Exemple #5
0
        /// <param name='operations'>
        /// Reference to the ContosoFront.IContosoAPI.
        /// </param>
        /// <param name='value'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <string> CreateAsync(this IContosoAPI operations, string value, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <string> result = await operations.CreateWithOperationResponseAsync(value, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }