Пример #1
0
        public async Task <IActionResult> DeleteAll()
        {
            try
            {
                foreach (var inv in _repo.GetAllInvitations())
                {
                    _repo.Delete(inv);

                    if (!await _repo.SaveAllAsync())
                    {
                        return(BadRequest("Could not delete invitations"));
                    }
                }

                return(NoContent());
            }
            catch (Exception ex)
            {
                _logger.LogError($"Threw exception while deleting invitations: {ex}");
            }

            return(BadRequest("Could not delete invitations"));
        }