32 lines
845 B
C#
32 lines
845 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Filters;
|
|
using RepositoryLibrary;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WebMVC.Controllers
|
|
{
|
|
public class ApiController : Controller
|
|
{
|
|
private readonly IRepository _repository;
|
|
public ApiController(IRepository repository)
|
|
{
|
|
_repository = repository;
|
|
}
|
|
public override void OnActionExecuted(ActionExecutedContext context)
|
|
{
|
|
// This is where I capture the error from when calling the ApiService
|
|
base.OnActionExecuted(context);
|
|
}
|
|
|
|
public async Task<IActionResult> Lookup()
|
|
{
|
|
var lookup = await _repository.Lookup();
|
|
return Ok(lookup);
|
|
}
|
|
}
|
|
}
|