Moving non-crud queries to separate controllers

This commit is contained in:
TypoMustakes
2023-12-05 15:28:46 +01:00
parent eaa177862e
commit 36a2e49067
3 changed files with 75 additions and 0 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/GetSubordinates")]
public class GetSubordinatesController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public GetSubordinatesController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet("{id}")]
public IQueryable<Employee> GetSubordinates(int id)
{
return LogicServices.GetSubordinates(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/WhoUsesService")]
public class WhoUsesServiceController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public WhoUsesServiceController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet("{id}")]
public IQueryable<Customer> WhoUsesService(int id)
{
return LogicServices.WhoUsesService(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/WhoWorksInMaintainerTeam")]
public class WhoWorksInMaintainerTeamController : ControllerBase
{
public ILogicServices LogicServices { get; set; }
public WhoWorksInMaintainerTeamController(ILogicServices LogicServices)
{
this.LogicServices = LogicServices;
}
[HttpGet("{id}")]
public IQueryable<Employee> WhoWorksInMaintainerTeam(int id)
{
return LogicServices.WhoWorksInMaintainerTeam(id);
}
}
}