first commit
This commit is contained in:
26
ServiceManager.API/Controllers/ArticlesController.cs
Normal file
26
ServiceManager.API/Controllers/ArticlesController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceManager.API.Models;
|
||||
using ServiceManager.API.Services;
|
||||
|
||||
namespace ServiceManager.API.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class ArticlesController : ControllerBase
|
||||
{
|
||||
private readonly IArticlesService _articlesService;
|
||||
|
||||
public ArticlesController(IArticlesService articlesService)
|
||||
{
|
||||
_articlesService = articlesService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Article>>> GetArticles()
|
||||
{
|
||||
var articles = await _articlesService.GetArticlesAsync();
|
||||
return Ok(articles);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user