/// <summary> /// 修改知识点 /// </summary> /// <param name="model">The model.</param> /// <exception cref="System.ArgumentNullException"></exception> public void UpdateKnowledge(KnowledgePiont model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } _knowledgeRepository.Update(model); }
public JsonResult AddKnowledge(int subjectId, int?parentId, string name) { if (string.IsNullOrEmpty(name)) { return(Json(new { state = false })); } var knowledge = new KnowledgePiont() { ParentId = parentId, Name = name, SubjectId = subjectId }; _knowledgeService.InsertKnowledge(knowledge); return(Json(new { state = true, data = knowledge.Id })); }