public IActionResult Delete(int id) { var resultDelete = _service.Delete(id); if (!resultDelete) { throw new InvalidOperationException(string.Format( "The layer with an ID of '{0}' could not be found. Make sure that layer exists.", id)); } return(Ok()); }