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