public void DeleteSkill() { var skillTodel = skillRepository.GetSkillByDegree(Degree.Competent); var skillTodel1 = skillRepository.GetSkillById(2); Assert.That(skillTodel, !Is.Null); Assert.That(skillTodel1, !Is.Null); Assert.IsTrue(skillRepository.Delete(skillTodel), "Something go wrong"); Assert.IsTrue(skillRepository.Delete(skillTodel1), "skillRepository.Delete(skillTodel1)"); contextManager.BatchSave(); }
public OutputBase DeleteSkill(DeleteSkillInput input) { _skillRepository.Delete(input.SkillId); return(new OutputBase { Message = "Skill Deleted", Success = true }); }
public void Delete(Skill item) { if (item.SkillId != null) { _repository.Delete(Mapping.Mapped.Map <Domain.Entities.Skill>(item)); } }
/// <summary> /// Remove skill from table Skill /// </summary> /// <param name="skill"></param> /// <returns></returns> public int Delete(string skillName) { //Retrieves skill id from unique skill name var skillId = _iSkillRepository.GetIdBySkillName(skillName); return(_iSkillRepository.Delete(skillId)); }
public void Delete(SkillViewModel model) { var item = _repository.FindById(model.Id); if (item != null) { _repository.Delete(item); } }
public IActionResult Delete(string id) { if (id != null) { _repository.Delete(id); return(Ok()); } return(BadRequest()); }
public ActionResult DeleteConfirmed(int id) { Skill skill = _SkillsRepository.GetSkillByID(id); skill.ObjectState = ObjectState.Deleted; _SkillsRepository.Delete(skill); _SkillsRepository.Save(); return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { var apiResult = TryExecute(() => { _skillRepository.Delete(id); _unitOfWork.Commit(); return(true); }, "Skill deleted sucessfully"); return(Json(apiResult, JsonRequestBehavior.AllowGet)); }
public IActionResult SkillDelete(int skillid) { var entity = _skillRepository.GetById(skillid); if (entity != null) { _skillRepository.Delete(entity); return(RedirectToAction("skilllist")); } return(NotFound()); }
public JsonResult DeleteSkill(int id) { Skill skill = _SkillsRepository.GetSkillByID(id); skill.ObjectState = ObjectState.Deleted; _SkillsRepository.Delete(skill); _SkillsRepository.Save(); return(Json("Deleted record successfully", JsonRequestBehavior.AllowGet)); }
public bool Delete(int?id) { if (_skillRepository.Get(id) == null) { MessageBox.Show("Sorry, your data is not found"); } else { status = _skillRepository.Delete(id); } return(status); }
public async Task <ActionResult <Skill> > DeleteSkill(int id) { var skill = await _skillRepository.GetById(id); if (skill == null) { return(NotFound()); } await _skillRepository.Delete(skill); return(skill); }
public IActionResult DeleteSkill(int id) { var skill = _repository.GetById(id); if (skill == null) { return(NotFound()); } _repository.Delete(skill); return(NoContent()); }
public IActionResult Delete(int id) { var skill = skillRepository.GetById(id); if (skill == null) { return(NotFound()); } skillRepository.Delete(skill); unitofwork.commit(); return(NoContent()); }
public void DeleteSkill(int id) { if (!ModelState.IsValid) { throw new HttpResponseException(HttpStatusCode.BadRequest); } Skill skill = _SkillsRepository.GetSkillByID(id); skill.ObjectState = ObjectState.Deleted; _SkillsRepository.Delete(skill); _SkillsRepository.Save(); }
public IActionResult Delete(int id) { var skill = _skillRepository.GetSkill(id); if (skill == null) { return(new NotFoundResult()); } var skillId = skill.Id; _skillRepository.Delete(skill); _skillRepository.Commit(); _workerService.RegisterTask("clean", skillId); return(NoContent()); }
public async Task <IActionResult> Delete(int id) { _logger.LogDebug("Starting delete"); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var skill = _skillRepository.GetSingle(id); _skillRepository.Delete(skill); await _skillRepository.SaveChangesAsync(); _logger.LogDebug("Finished delete"); return(new NoContentResult()); }
public async Task <ActionResult> DeleteSkill(int id) { try { var skillToDelete = await _repository.GetSkillId(id); if (skillToDelete == null) { return(NotFound($"Skill with Id = {id} not found")); } return(Ok(await _repository.Delete(id))); } catch (System.Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "There were error in deleting the data from the database!")); } }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(RedirectToPage("/SkillNotFound")); } Skill = await _repository.GetSkillId(id.Value); if (Skill == null) { return(RedirectToPage("/SkillNotFound")); } Skill agent = await _repository.Delete(Skill.SkillId); if (agent == null) { return(RedirectToPage("/DatabaseError")); } return(RedirectToPage("Index")); }
public async Task <IActionResult> Delete(int id) { try { _logger.LogInfo($"Skill Delete attempted - id: {id}"); if (string.IsNullOrWhiteSpace(id.ToString())) { _logger.LogWarn($"Skill Delete failed: no id was provided."); return(BadRequest()); } var isExists = await _skillRepository.IsExists(id); if (!isExists) { _logger.LogWarn($"Skill Update failed: no Skill with id: {id} was found."); return(NotFound()); } if (!ModelState.IsValid) { _logger.LogWarn($"Skill Data was Invalid."); return(BadRequest(ModelState)); } var skill = await _skillRepository.FindById(id); var isSuccess = await _skillRepository.Delete(skill); if (!isSuccess) { return(InternalError($"Delete Skill Operation failed.")); } _logger.LogWarn($"Skill with id: {id} successfully deleted."); return(NoContent()); } catch (Exception e) { return(InternalError($"{e.Message} - {e.InnerException}")); } }
public IActionResult DeleteSkill([FromQuery] int skillId) { var lang = Request.Headers["language"].ToString(); var errorMessages = new List <string>(); try { var skill = _skillRepository.FindById(skillId); if (skill == null) { return(NotFound()); } var deletedSkill = _skillRepository.Delete(skillId); return(Ok(new { deletedSkillId = deletedSkill.Id, categoryId = skill.CategoryId })); } catch { errorMessages.Add(_translator.GetTranslation("ERROR", lang)); return(BadRequest(new { errors = errorMessages })); } }
public bool DeleteSkill(int?Id) { return(_iSkillRepository.Delete(Id)); }
public void Delete(string id) { _repository.Delete(id); }
// DELETE api/<controller>/5 public void Delete(string id) { _skillRepository.Delete(Guid.Parse(id)); }
public void Delete(int id) => _skillRepository.Delete(id);
public IActionResult Delete(int id) { _skillRepository.Delete(id); return(NoContent()); }
public void Delete(Guid entityId) { repository.Delete(entityId); }
public void Delete(Int32 id) { repository.Delete(repository.GetById(id)); }
public IActionResult Delete(Guid ProyectoId) { repository.Delete(ProyectoId); return(Ok(true)); }
public IActionResult Delete(string id) { _repository.Delete(id); return(Ok()); }