public async Task <IActionResult> UploadFile(UserDto model) { if (model.UploadedFile.Length > 0) { using (var ms = new MemoryStream()) { model.UploadedFile.CopyTo(ms); model.FileContent = ms.ToArray(); model = await _employeeFacadeApiClient.PutUserTaskCalendarFileUpload(model.Id, model); return(Json(string.IsNullOrWhiteSpace(model.ErrorMessage)? model.SuccessMessage: model.ErrorMessage)); } } return(RedirectToAction("Index")); }