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