Syncer АИХ ИТ
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
private readonly IHostService hostService;
|
||||
|
||||
public HomeController(IHostService hostService)
|
||||
{
|
||||
return View();
|
||||
this.hostService = hostService;
|
||||
}
|
||||
|
||||
[HttpGet("test")]
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
var hosts = await hostService.Get().ToListAsync();
|
||||
//foreach (var host in hosts) { logger.LogInformation($"{host.HostName}"); }
|
||||
//return View();
|
||||
|
||||
return Ok(hosts.Select(t => new { t.HostName, t.IP, t.Id }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user