public GetTagsDTO GetTagById(int id) { Tag tag = _tagRepository.GetById(id); GetTagsDTO tagsDTO = new GetTagsDTO() { id = tag.id, tags = tag.tags }; return(tagsDTO); }
public IList <GetTagsDTO> GetTags() { IList <Tag> tags = _tagRepository.Table.ToList <Tag>(); IList <GetTagsDTO> tagsList = new List <GetTagsDTO>(); foreach (var tag in tags) { GetTagsDTO tagsDTO = new GetTagsDTO() { id = tag.id, tags = tag.tags }; tagsList.Add(tagsDTO); } return(tagsList); }
// GET: Tags/Delete/5 public ActionResult Delete(int id) { GetTagsDTO tag = _tagsService.GetTagById(id); return(View(tag)); }