Adding two more non-crud queries

This commit is contained in:
TypoMustakes
2023-12-10 17:20:48 +01:00
parent b71634d125
commit 1a86991b52
3 changed files with 76 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Mvc;
using WD7UVN_HFT_2023241.Logic;
using System.Linq;
using WD7UVN_HFT_2023241.Models;
namespace WD7UVN_HFT_2023241.Endpoint
{
[ApiController]
[Route("api/WhoIsResponsibleForService")]
public class WhoIsReponsibleForServiceController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public WhoIsReponsibleForServiceController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet("{id}")]
public Employee WhoIsResponsibleForService([FromQuery] int id)
{
return LogicServices.WhoIsResponsibleForService(id);
}
}
}

View File

@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Mvc;
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;
}
[HttpGet("{id}")]
public IQueryable<Customer> WhoUsesService([FromQuery] int id)
{
return LogicServices.WhoUsesService(id);
}
}
}