Ejemplo n.º 1
0
 public async Task <IActionResult> Get(string username) =>
 (await _profilesService.ViewProfileAsync(CurrentUserId.SomeNotNull(), username))
 .Match <IActionResult>(profile => Ok(new { profile }), Error);
Ejemplo n.º 2
0
        public async Task <IActionResult> Get(GetArticlesModel request)
        {
            var articles = await _articlesService.GetAsync(CurrentUserId.SomeNotNull(), request);

            return(Ok(new { articles, articlesCount = articles.Length }));
        }
Ejemplo n.º 3
0
 public async Task <IActionResult> GetBySlug(string slug) =>
 (await _articlesService.GetBySlugAsync(CurrentUserId.SomeNotNull(), slug))
 .Match <IActionResult>(article => Ok(new { article }), NotFound);
Ejemplo n.º 4
0
 public async Task <IActionResult> GetComments(string slug) =>
 (await _commentsService.GetCommentsForArticle(CurrentUserId.SomeNotNull(), slug))
 .Match <IActionResult>(comments => Ok(new { comments }), Error);