public async Task <ActionResult> Edit(int id, PostBindingModel post) { var model = new PostDataModel() { Titulo = post.Titulo, Descricao = post.Descricao, PerfilId = post.PerfilId }; try { HttpFileCollectionBase files = Request.Files; int fileCount = files.Count; await _blobHelper.SetupCloudBlob(connectionString); var blob = _blobHelper._blobCointainer.GetBlockBlobReference(_blobHelper.GetRandomBlobName(files[0].FileName)); await blob.UploadFromStreamAsync(files[0].InputStream); model.Foto = blob.StorageUri.PrimaryUri.ToString(); await _clientHelper.PutPostAsync(id, model); return(RedirectToAction("Index")); } catch { return(View()); } }