示例#1
0
        public IHttpActionResult RollBack([FromUri] Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(this.Error().InvalidParameters("Invalid parameters"));
            }

            // Check if update exists
            IUpdate update = _updateManager.GetUpdate(id);

            if (update == null)
            {
                return(NotFound());
            }

            // Check if update supports roll back
            if (!update.SupportsRollback)
            {
                return(this.Error().InvalidParameters("Update does not support roll back"));
            }

            // Update
            _updateManager.RollBack(id);

            return(Ok());
        }