Syncer АИХ ИТ

This commit is contained in:
Mikhail Kuznetsov
2023-06-01 12:30:38 +10:00
parent e34037267c
commit 118cd280df
27 changed files with 953 additions and 8 deletions

View File

@@ -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 }));
}
}
}