Пример #1
0
        public async Task <IActionResult> Delete(int id)
        {
            var information = await _context.Informations.FirstOrDefaultAsync(i => i.Id == id);

            _context.Remove(information);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Пример #2
0
        public async Task <IActionResult> Delete(int Id)
        {
            var skill = await _context.Skills.FindAsync(Id);

            _context.Remove(skill);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Пример #3
0
        public async Task <IActionResult> Delete(int id)
        {
            var education = await _context.Educations.FindAsync(id);

            DeleteImage(education);
            _context.Remove(education);
            await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Пример #4
0
        public void Remove(string tagName)
        {
            Tag remTag = GetByName(tagName);

            if (remTag != null)
            {
                _contex.Remove(remTag);
                _contex.SaveChanges();
            }
        }
Пример #5
0
        public void Remove(int projectId)
        {
            Project remProject = Get(projectId);

            if (remProject != null)
            {
                _context.Remove(remProject);
                _context.SaveChanges();
            }
        }
        public async Task <Unit> Handle(EliminarCurriculumCommand request, CancellationToken cancellationToken)
        {
            var curriculumExistente = await _dbContext.Curriculum.FirstOrDefaultAsync(x => x.Id == request.IdCurriculum);

            if (curriculumExistente is null)
            {
                throw new NotFoundException(nameof(Curriculum), request.IdCurriculum);
            }

            _dbContext.Remove(curriculumExistente);
            await _dbContext.SaveChangesAsync();

            return(Unit.Value);
        }