Exemplo n.º 1
0
        public async Task <IActionResult> Get()
        {
            var tags = await _tagsService.GetAll();

            if (tags == null)
            {
                return(NotFound());
            }

            return(Ok(tags));
        }
Exemplo n.º 2
0
        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)));
        }
Exemplo n.º 3
0
 public IEnumerable <TagViewModel> GetAll()
 {
     return(_tagsService.GetAll().ToViewModels());
 }
Exemplo n.º 4
0
 public IEnumerable <TagDTO> GetTags()
 {
     return(_service.GetAll());
 }
Exemplo n.º 5
0
 public IEnumerable <TagViewModel> GetAll()
 {
     return(TagsMapper.MapRange(_tagsService.GetAll()));
 }
        public async Task <IActionResult> Get()
        {
            var orders = await _tagsService.GetAll();

            return(Ok(orders));
        }