Added Main
This commit is contained in:
32
noteApi/Controllers/StatusController.cs
Normal file
32
noteApi/Controllers/StatusController.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user