Initial commit
This commit is contained in:
32
PartSource.Api/Controllers/SearchController.cs
Normal file
32
PartSource.Api/Controllers/SearchController.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using PartSource.Data.Nexpart;
|
||||
using PartSource.Services;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Api.Controllers
|
||||
{
|
||||
[Route("[controller]")]
|
||||
[ApiController]
|
||||
public class SearchController : BaseNexpartController
|
||||
{
|
||||
private readonly NexpartService _nexpartService;
|
||||
|
||||
public SearchController()
|
||||
{
|
||||
this._nexpartService = new NexpartService();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("makes/vehicletypeid/{vehicleTypeId}")]
|
||||
public async Task<ActionResult> GetMakes(int vehicleTypeId)
|
||||
{
|
||||
SearchController searchController = this;
|
||||
MakeSearch requestContent = new MakeSearch()
|
||||
{
|
||||
VehicleTypeId = new int[] { vehicleTypeId }
|
||||
};
|
||||
MakeSearchResponse response = await searchController._nexpartService.SendRequest<MakeSearch, MakeSearchResponse>(requestContent);
|
||||
return searchController.NexpartResponse<MakeSearchResponse, Makes>(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user