Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created July 23, 2019 08:06
Show Gist options
  • Select an option

  • Save ntakouris/3e713467fd652db5dd0f4129b49fa422 to your computer and use it in GitHub Desktop.

Select an option

Save ntakouris/3e713467fd652db5dd0f4129b49fa422 to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Tweetbook.Contracts.V1;
using Tweetbook.Contracts.V1.Requests;
using Tweetbook.Domain;
using Tweetbook.Extensions;
using Tweetbook.Services;
namespace Tweetbook.Controllers.V1
{
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
public class TagsController : Controller
{
private readonly IPostService _postService;
public TagsController(IPostService postService)
{
_postService = postService;
}
[HttpGet(ApiRoutes.Tags.GetAll)]
public async Task<IActionResult> GetAll()
{
return Ok(await _postService.GetAllTagsAsync());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment