コード例 #1
0
        public async Task <NotificationTypeResponse> DeleteAsync(int id)
        {
            var existingNotificationType = await _notificationTypeRepository.FindById(id);

            try
            {
                _notificationTypeRepository.Remove(existingNotificationType);
                await _unitOfWork.CompleteAsync();

                return(new NotificationTypeResponse(existingNotificationType));
            }
            catch (Exception ex)
            {
                return(new NotificationTypeResponse($"An error ocurred while deleting the notification type: {ex.Message}"));
            }
        }