/// <param name='operations'>
 /// Reference to the Gilboy.Demo.Web.IModuleOperations.
 /// </param>
 /// <param name='module'>
 /// Required.
 /// </param>
 public static object PostByModule(this IModuleOperations operations, Module module)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IModuleOperations)s).PostByModuleAsync(module);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public static IList<Module> DeserializeJson(JToken inputObject)
 {
     IList<Module> deserializedObject = new List<Module>();
     foreach (JToken iListValue in ((JArray)inputObject))
     {
         Module module = new Module();
         module.DeserializeJson(iListValue);
         deserializedObject.Add(module);
     }
     return deserializedObject;
 }
 public async Task<ActionResult> Create(ModuleViewModel model)
 {
     if (!ModelState.IsValid)
     {
         var users = await _userService.GetByTenantidWithOperationResponseAsync("abc123");
         if (users.Response.IsSuccessStatusCode)
         {
             model.Users = users.Body;
         }
         return View(model);
     }
     var module = new Module() {CreatorId = model.SelectedUserId, TenantId = "abc123", Title = model.ModuleTitle};
     await _moduleService.PostByModuleWithOperationResponseAsync(module);
     return RedirectToAction("Index");
 }
 /// <param name='operations'>
 /// Reference to the Gilboy.Demo.Web.IModuleOperations.
 /// </param>
 /// <param name='module'>
 /// Required.
 /// </param>
 /// <param name='cancellationToken'>
 /// Cancellation token.
 /// </param>
 public static async Task<object> PostByModuleAsync(this IModuleOperations operations, Module module, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     Microsoft.Rest.HttpOperationResponse<object> result = await operations.PostByModuleWithOperationResponseAsync(module, cancellationToken).ConfigureAwait(false);
     return result.Body;
 }