Files

34 lines
776 B
C#
Raw Permalink Normal View History

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