public async Task <ActionResult> Create(GaleriaBindingModel galeria) { var model = new GaleriaDataModel() { PerfilId = galeria.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.FotoUrl = blob.StorageUri.PrimaryUri.ToString(); await _clientHelper.PostGaleriaAsync(model); return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <HttpResponseMessage> PutGaleriaAsync(int id, GaleriaDataModel model) { return(await _client.PutAsJsonAsync($"api/Galeria/{id}", model)); }
// GaleriaHelper #region public async Task <HttpResponseMessage> PostGaleriaAsync(GaleriaDataModel model) { return(await _client.PostAsJsonAsync("api/Galeria/Post", model)); }