You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
using AccessStudy.Core;
|
|
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
namespace AccessStudy.OledbApi.Controllers
|
|
|
|
|
{
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class DefaultController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger<DefaultController> _logger;
|
|
|
|
|
private readonly StudentServer _studentServer;
|
|
|
|
|
|
|
|
|
|
public DefaultController(ILogger<DefaultController> logger,StudentServer studentServer)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
_studentServer = studentServer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var students = _studentServer.GetAll();
|
|
|
|
|
|
|
|
|
|
return new JsonResult(students);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|