public async Task <IActionResult> Get(string username) => (await _profilesService.ViewProfileAsync(CurrentUserId.SomeNotNull(), username)) .Match <IActionResult>(profile => Ok(new { profile }), Error);
public async Task <IActionResult> Get(GetArticlesModel request) { var articles = await _articlesService.GetAsync(CurrentUserId.SomeNotNull(), request); return(Ok(new { articles, articlesCount = articles.Length })); }
public async Task <IActionResult> GetBySlug(string slug) => (await _articlesService.GetBySlugAsync(CurrentUserId.SomeNotNull(), slug)) .Match <IActionResult>(article => Ok(new { article }), NotFound);
public async Task <IActionResult> GetComments(string slug) => (await _commentsService.GetCommentsForArticle(CurrentUserId.SomeNotNull(), slug)) .Match <IActionResult>(comments => Ok(new { comments }), Error);