コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }