You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
835 B
34 lines
835 B
using Dto.Factories;
|
|
using Interface;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Modele.Classe;
|
|
|
|
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
|
|
namespace Api.Controllers
|
|
{
|
|
[Route("[controller]")]
|
|
[ApiController]
|
|
public class FullSession : ControllerBase
|
|
{
|
|
private readonly IApi data;
|
|
|
|
public FullSession(IApi manager)
|
|
{
|
|
this.data = manager;
|
|
}
|
|
|
|
// GET: api/<FullSession>
|
|
[HttpGet]
|
|
public async Task<IActionResult> Get()
|
|
{
|
|
IEnumerable<Session> sessions = (await data.GetFullSessions());
|
|
if (sessions == null)
|
|
{
|
|
return NotFound();
|
|
}
|
|
return Ok(sessions.Select(e => e.ModeleToDTO()));
|
|
}
|
|
}
|
|
}
|