Example #1
0
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public static IList<Enrollment> DeserializeJson(JToken inputObject)
 {
     IList<Enrollment> deserializedObject = new List<Enrollment>();
     foreach (JToken iListValue in ((JArray)inputObject))
     {
         Enrollment enrollment = new Enrollment();
         enrollment.DeserializeJson(iListValue);
         deserializedObject.Add(enrollment);
     }
     return deserializedObject;
 }
 /// <param name='operations'>
 /// Reference to the AjaxModuleTest.IEnrollments.
 /// </param>
 /// <param name='id'>
 /// Required.
 /// </param>
 /// <param name='enrollment'>
 /// Required.
 /// </param>
 /// <param name='cancellationToken'>
 /// Cancellation token.
 /// </param>
 public static async Task<object> PutEnrollmentAsync(this IEnrollments operations, int id, Enrollment enrollment, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     Microsoft.Rest.HttpOperationResponse<object> result = await operations.PutEnrollmentWithOperationResponseAsync(id, enrollment, cancellationToken).ConfigureAwait(false);
     return result.Body;
 }
 /// <param name='operations'>
 /// Reference to the AjaxModuleTest.IEnrollments.
 /// </param>
 /// <param name='id'>
 /// Required.
 /// </param>
 /// <param name='enrollment'>
 /// Required.
 /// </param>
 public static object PutEnrollment(this IEnrollments operations, int id, Enrollment enrollment)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IEnrollments)s).PutEnrollmentAsync(id, enrollment);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <param name='operations'>
 /// Reference to the AjaxModuleTest.IEnrollments.
 /// </param>
 /// <param name='enrollment'>
 /// Required.
 /// </param>
 /// <param name='cancellationToken'>
 /// Cancellation token.
 /// </param>
 public static async Task<Enrollment> PostEnrollmentAsync(this IEnrollments operations, Enrollment enrollment, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     Microsoft.Rest.HttpOperationResponse<AjaxModuleTest.Models.Enrollment> result = await operations.PostEnrollmentWithOperationResponseAsync(enrollment, cancellationToken).ConfigureAwait(false);
     return result.Body;
 }