Moving non-crud queries to separate controllers
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user