public ActionResult Edit(PhotoViewModel photoViewModel, FormCollection collection) { if (ModelState.IsValid) { var photo = this.FromViewModel(photoViewModel); var token = photoViewModel.PartitionKey == "Public" ? this.PublicTableSas : this.AuthenticatedTableSas; CloudTableClient cloudTableClient = new CloudTableClient(this.UriTable, new StorageCredentials(token)); var photoContext = new PhotoDataServiceContext(cloudTableClient); photoContext.UpdatePhoto(photo); return this.RedirectToAction("Index"); } return this.View(); }
public ActionResult Edit(PhotoViewModel photoViewModel, FormCollection collection) { if (ModelState.IsValid) { var photo = this.FromViewModel(photoViewModel); //Update information in Table Storage CloudTableClient cloudTableClient = this.StorageAccount.CreateCloudTableClient(); var photoContext = new PhotoDataServiceContext(cloudTableClient); photoContext.UpdatePhoto(photo); return this.RedirectToAction("Index"); } return this.View(); }