22 lines
610 B
C#
22 lines
610 B
C#
using CPATapi.Server.Interfaces;
|
|
using CPATapi.Server.Models;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace CPATapi.Server.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class ContactController(ILogger<ContactController> logger, ITapiDirectoryRepository tapiDirectory) : ControllerBase
|
|
{
|
|
|
|
private readonly ILogger<ContactController> _logger = logger;
|
|
|
|
[HttpGet]
|
|
[Produces("application/json")]
|
|
[ProducesResponseType<IEnumerable<TapiContact>>(StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> GetAsync()
|
|
{
|
|
return Ok(await tapiDirectory.GetAllAsync());
|
|
}
|
|
}
|