Example #1
0
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public static IList<Student> DeserializeJson(JToken inputObject)
 {
     IList<Student> deserializedObject = new List<Student>();
     foreach (JToken iListValue in ((JArray)inputObject))
     {
         Student student = new Student();
         student.DeserializeJson(iListValue);
         deserializedObject.Add(student);
     }
     return deserializedObject;
 }
Example #2
0
 /// <param name='operations'>
 /// Reference to the AjaxModuleTest.IStudents.
 /// </param>
 /// <param name='id'>
 /// Required.
 /// </param>
 /// <param name='student'>
 /// Required.
 /// </param>
 /// <param name='cancellationToken'>
 /// Cancellation token.
 /// </param>
 public static async Task<object> PutStudentAsync(this IStudents operations, int id, Student student, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     Microsoft.Rest.HttpOperationResponse<object> result = await operations.PutStudentWithOperationResponseAsync(id, student, cancellationToken).ConfigureAwait(false);
     return result.Body;
 }
Example #3
0
 /// <param name='operations'>
 /// Reference to the AjaxModuleTest.IStudents.
 /// </param>
 /// <param name='id'>
 /// Required.
 /// </param>
 /// <param name='student'>
 /// Required.
 /// </param>
 public static object PutStudent(this IStudents operations, int id, Student student)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IStudents)s).PutStudentAsync(id, student);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Example #4
0
 /// <param name='operations'>
 /// Reference to the AjaxModuleTest.IStudents.
 /// </param>
 /// <param name='student'>
 /// Required.
 /// </param>
 /// <param name='cancellationToken'>
 /// Cancellation token.
 /// </param>
 public static async Task<Student> PostStudentAsync(this IStudents operations, Student student, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     Microsoft.Rest.HttpOperationResponse<AjaxModuleTest.Models.Student> result = await operations.PostStudentWithOperationResponseAsync(student, cancellationToken).ConfigureAwait(false);
     return result.Body;
 }