public static Classifier ToClassifier(this ClassifierDto dto) { return(new Classifier { Id = dto.Id, Name = dto.Name, Description = dto.Description, ParentId = dto.ParentId, Classifiers = dto.Classifiers.Select(cl => cl.ToClassifier()).ToList() }); }
public static Classifier ToEntity(this ClassifierDto dto) { return(new Classifier { Id = dto.Id, Name = dto.Name, Description = dto.Description, Classifiers = dto.Classifiers?.Select(e => e.ToEntity()).ToList(), Words = dto.Words?.Select(e => e.ToEntity()).ToList(), ParentId = dto.ParentId }); }
private void AddCurrentWordToClassifier(ClassifierDto classif, string classifierName) { try { var curClassifier = _allClassifierDtos.First(cl => cl.Name == classifierName); if (curClassifier != null) { curClassifier.Words = curClassifier?.Words ?? new List <WordDto>(); curClassifier.Words.Add(new WordDto { Name = WordToStore }); _classifierService.Update(curClassifier); } } catch (Exception e) { } }
public bool DeleteWordFromClassifier(int wordId, ClassifierDto dto) { return(DeleteWordFromClassifier(wordId, dto.Id)); }
public ClassifierDto PutClassifier([FromBody] ClassifierDto classifierDto) { return(new ClassifierDto(dal.SaveClassifier(classifierDto))); }
public ClassifierDto PostClassifier([FromBody] ClassifierDto classifierDto) { return(new ClassifierDto(dal[classifierDto.TypeCode].AddMember(classifierDto))); }