new-infofer-scraper/server/Controllers/V2/TrainsController.cs
Dan Cojocaru 7b13d09514
A whole C# rewrite
In one commit.
Yes, you're seeing it right.
Yes, I don't know what I was thinking.
2022-08-03 00:38:53 +03:00

22 lines
495 B
C#

using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Server.Services.Interfaces;
namespace Server.Controllers.V2;
[ApiController]
[ApiExplorerSettings(GroupName = "v2")]
[Route("/v2/[controller]")]
public class TrainsController : Controller {
private IDatabase Database { get; }
public TrainsController(IDatabase database) {
this.Database = database;
}
[HttpGet("")]
public ActionResult<IEnumerable<ITrainRecord>> ListTrains() {
return Ok(Database.Trains);
}
}