2023-12-10 17:20:48 +01:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2023-12-13 22:04:06 +01:00
|
|
|
using System;
|
2023-12-10 17:20:48 +01:00
|
|
|
using WD7UVN_HFT_2023241.Logic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using WD7UVN_HFT_2023241.Models;
|
|
|
|
|
|
|
|
|
|
namespace WD7UVN_HFT_2023241.Endpoint
|
|
|
|
|
{
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Route("api/WhoMaintainsService")]
|
|
|
|
|
public class WhoMaintainsServiceController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
public ILogicServices LogicServices { get; set; }
|
|
|
|
|
|
|
|
|
|
public WhoMaintainsServiceController(ILogicServices LogicServices)
|
|
|
|
|
{
|
|
|
|
|
this.LogicServices = LogicServices;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-10 17:35:40 +01:00
|
|
|
[HttpGet()]
|
2024-05-05 17:11:35 +02:00
|
|
|
public IQueryable<Employee>? WhoMaintainsService([FromQuery] int id)
|
2023-12-10 17:20:48 +01:00
|
|
|
{
|
2023-12-13 22:04:06 +01:00
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return LogicServices.WhoMaintainsService(id);
|
|
|
|
|
}
|
|
|
|
|
catch (NullReferenceException)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2023-12-10 17:20:48 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|