Пример #1
0
        public IActionResult DeleteFieldGroup(string slug)
        {
            try
            {
                var obj = _bl.GetFieldGroup(slug);
                _bl.DeleteFieldGroup(obj);
                _bl.SaveChanges();
                _log.LogInformation("FieldGroup '{0}' deleted by '{1}'", obj.Name, User.Identity.Name);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_bl.FieldGroupExists(slug))
                {
                    _log.LogWarning("Not Found: FieldGroup '{0}' not found", slug);
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Ok());
        }