public async Task <IActionResult> Get() { var tags = await _tagsService.GetAll(); if (tags == null) { return(NotFound()); } return(Ok(tags)); }
public IActionResult Details(int id, Answer.SortField sort = AskMate.Common.Domain.Answer.SortField.SubmissionTime, bool ascending = false) { int?userId = int.TryParse(HttpContext.User.FindFirstValue("Id"), out var i) ? i : (int?)null; var question = _questionsService.GetOne(id); var tags = _tagsService.GetAll(id); var answers = _answersService.GetAll(new IAnswersService.GetAllOptions(sort, ascending) { QuestionId = id }); var questionComments = _commentsService.GetAll(ICommentsService.CommentType.Question, id); var answerComments = _commentsService.GetAll(ICommentsService.CommentType.Answer, answers.Select(x => x.Id).ToArray()); _questionsService.View(userId, id); return(View(new QuestionDetailModel(question, tags, questionComments, answers, answerComments))); }
public IEnumerable <TagViewModel> GetAll() { return(_tagsService.GetAll().ToViewModels()); }
public IEnumerable <TagDTO> GetTags() { return(_service.GetAll()); }
public IEnumerable <TagViewModel> GetAll() { return(TagsMapper.MapRange(_tagsService.GetAll())); }
public async Task <IActionResult> Get() { var orders = await _tagsService.GetAll(); return(Ok(orders)); }