예제 #1
0
        public ActionResult Create(BlobSetViewModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return this.View(model);
            }

            var blobSet = new BlobSet
            {
                Name = model.Name,
                Description = model.Description
            };

            this.blobSetService.CreateBlobSet(blobSet);

            if (model.AddPermissions)
            {
                return RedirectToAction("Permissions", new { id = blobSet.BlobSetId });
            }
            else
            {
                return RedirectToAction("Details", new { id = blobSet.BlobSetId });
            }
        }
예제 #2
0
        public ActionResult Edit(Guid id, BlobSetViewModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return View(model);
            }

            var blob = this.blobSetService.GetBlobSetById(id);
            blob.Name = model.Name;
            blob.Description = model.Description;
            this.blobSetService.UpdateBlobSet(blob);

            return RedirectToAction("Details", new { id = id });
        }