RestAPI merging + views changes.
This commit is contained in:
commit
c5603b1ceb
@ -1,5 +1,6 @@
|
|||||||
using ComputerStoreContracts.BindingModels;
|
using ComputerStoreContracts.BindingModels;
|
||||||
using ComputerStoreContracts.BusinessLogicContracts;
|
using ComputerStoreContracts.BusinessLogicContracts;
|
||||||
|
using ComputerStoreContracts.SearchModels;
|
||||||
using ComputerStoreContracts.ViewModels;
|
using ComputerStoreContracts.ViewModels;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@ -38,6 +39,20 @@ namespace ComputerStoreRestAPI.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public ComponentViewModel? GetComponent(int id)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return _componentLogic.ReadElement(new ComponentSearchModel { ID = id } );
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Receiving list of components error.");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id}")]
|
||||||
public bool DeleteComponent(int id)
|
public bool DeleteComponent(int id)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user