Files
NoteApp/noteApi/Controllers/StatusController.cs
2025-02-08 14:01:15 +01:00

33 lines
729 B
C#

using Microsoft.AspNetCore.Mvc;
using Microsoft.VisualBasic;
using noteApi.Interfaces;
namespace noteApi.Controllers
{
[Route("api/status")]
[ApiController]
public class StatusController : ControllerBase
{
public readonly INoteRepository _noteRepo;
public StatusController(INoteRepository noteRepository)
{
_noteRepo = noteRepository;
}
[HttpGet]
public async Task<IActionResult> Get()
{
try
{
var stock = await _noteRepo.GetAllAsync();
return Ok();
}
catch (Exception ex)
{
return StatusCode(503);
}
}
}
}