public ActionResult Update(AttachmentUpdate value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            var attachment = this.AttachmentService.GetById(value.Id);

            if (attachment == null)
            {
                return base.HttpNotFound();
            }

            var privilege = new AttachmentPrivilege();

            if (!privilege.CanUpdate(attachment))
            {
                return NotAuthorized();
            }

            value.Validate();

            if (value.IsValid)
            {
                value.ValueToModel(attachment);

                this.AttachmentService.Update(attachment);

                value.SuccessMessage(Messages.AttachmentUpdated);
            }
            else
            {
                value.CopyToModel(ModelState);
            }

            value.Initialize(attachment);

            return base.View(Views.Update, value);
        }
        public ActionResult Update(int id)
        {
            var attachment = this.AttachmentService.GetById(id);

            if (attachment == null)
            {
                return HttpNotFound();
            }

            var privilege = new AttachmentPrivilege();

            return privilege.CanUpdate(attachment) ? base.View(Views.Update, new AttachmentUpdate(attachment)) : NotAuthorized();
        }