public async Task <ActionResult <HardDriveDiskReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var hddReadDto = await _hardDriveDisksService.GetHardDiskDriveByIdAsync(id); return(hddReadDto == null?ResponseResultsHelper.NotFoundByIdResult(id) : Json(hddReadDto)); }
public async Task <ActionResult> Create([FromBody] PowerSupplyInsertDto powerSupply) { _logger.LogForModelInsert(HttpContext); var insertResult = await _powerSuppliesService.CreatePowerSupplyAsync(powerSupply); return(insertResult ? Json(powerSupply) : ResponseResultsHelper.InsertError()); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] PowerSupplyUpdateDto powerSupply) { _logger.LogForModelUpdate(HttpContext, id); var result = await _powerSuppliesService.UpdatePowerSupplyAsync(id, powerSupply); return(result ? Json(powerSupply) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] RandomAccessMemoryUpdateDto randomAccessMemory) { _logger.LogForModelUpdate(HttpContext, id); var result = await _randomAccessMemoryService.UpdateRandomAccessMemoryAsync(id, randomAccessMemory); return(result ? Json(randomAccessMemory) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult <RandomAccessMemoryReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var ram = await _randomAccessMemoryService.GetRandomAccessMemoryByIdAsync(id); return(ram == null?ResponseResultsHelper.NotFoundByIdResult(id) : Json(ram)); }
public async Task <ActionResult> Delete([FromRoute] int id) { _logger.LogForModelDelete(HttpContext, id); var result = await _randomAccessMemoryService.DeleteRandomAccessMemoryAsync(id); return(result ? Ok() : ResponseResultsHelper.DeleteError()); }
public async Task <ActionResult> Insert([FromBody] RandomAccessMemoryInsertDto randomAccessMemory) { _logger.LogForModelInsert(HttpContext); var insertResult = await _randomAccessMemoryService.CreateRandomAccessMemoryAsync(randomAccessMemory); return(insertResult ? Json(randomAccessMemory) : ResponseResultsHelper.InsertError()); }
public async Task <ActionResult> Create([FromBody] MotherboardInsertDto motherboard) { _logger.LogForModelInsert(HttpContext); var insertResult = await _motherboardsService.CreateMotherboardAsync(motherboard); return(insertResult ? Json(motherboard) : ResponseResultsHelper.InsertError()); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] MotherboardUpdateDto motherboard) { _logger.LogForModelUpdate(HttpContext, id); var result = await _motherboardsService.UpdateMotherboardAsync(id, motherboard); return(result ? Json(motherboard) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] HardDriveDiskUpdateDto hardDriveDisk) { _logger.LogForModelUpdate(HttpContext, id); var result = await _hardDriveDisksService.UpdateHardDriveDiskAsync(id, hardDriveDisk); return(result ? Json(hardDriveDisk) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult> Delete([FromRoute] int id) { _logger.LogForModelDelete(HttpContext, id); var result = await _powerSuppliesService.DeletePowerSupplyAsync(id); return(result ? Ok() : ResponseResultsHelper.DeleteError()); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] ProducerUpdateDto producer) { _logger.LogForModelUpdate(HttpContext, id); var result = await _producersService.UpdateProducerAsync(id, producer); return(result ? Json(producer) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult> Create([FromBody] HardDriveDiskInsertDto hardDriveDisk) { _logger.LogForModelInsert(HttpContext); var insertResult = await _hardDriveDisksService.CreateHardDriveDiskAsync(hardDriveDisk); return(insertResult ? Json(hardDriveDisk) : ResponseResultsHelper.InsertError()); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] SolidStateDriveUpdateDto solidStateDrive) { _logger.LogForModelUpdate(HttpContext, id); var result = await _solidStateDrivesService.UpdateSolidStateDriveAsync(id, solidStateDrive); return(result ? Json(solidStateDrive) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult> Delete([FromRoute] int id) { _logger.LogForModelDelete(HttpContext, id); var result = await _solidStateDrivesService.DeleteSolidStateDriveAsync(id); return(result ? Ok() : ResponseResultsHelper.DeleteError()); }
public async Task <ActionResult <SolidStateDriveReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var ssd = await _solidStateDrivesService.GetSolidStateDriveByIdAsync(id); return(ssd == null?ResponseResultsHelper.NotFoundByIdResult(id) : Json(ssd)); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] VideoCardCoreUpdateDto videoCardCore) { _logger.LogForModelUpdate(HttpContext, id); var result = await _videoCardCoresService.UpdateVideoCardCoreAsync(id, videoCardCore); return(result ? Json(videoCardCore) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult> Create([FromBody] SolidStateDriveInsertDto solidStateDrive) { _logger.LogForModelInsert(HttpContext); var insertResult = await _solidStateDrivesService.CreateSolidStateDriveAsync(solidStateDrive); return(insertResult ? Json(solidStateDrive) : ResponseResultsHelper.InsertError()); }
public async Task <ActionResult> Create([FromBody] VideoCardCoreInsertDto videoCardCore) { _logger.LogForModelInsert(HttpContext); var insertResult = await _videoCardCoresService.CreateVideoCardCoreAsync(videoCardCore); return(insertResult ? Json(videoCardCore) : ResponseResultsHelper.InsertError()); }
public async Task <ActionResult <ProducerReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var producer = await _producersService.GetProducerByIdAsync(id); return(producer == null?ResponseResultsHelper.NotFoundByIdResult(id) : Json(producer)); }
public async Task <ActionResult <ProcessorCoreReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var cpuCore = await _processorCoresService.GetProcessorCoreByIdAsync(id); return(cpuCore == null?ResponseResultsHelper.NotFoundByIdResult(id) : Json(cpuCore)); }
public async Task <ActionResult> Update([FromRoute] int id, [FromBody] ProcessorCoreUpdateDto cpuCore) { _logger.LogForModelUpdate(HttpContext, id); var result = await _processorCoresService.UpdateProcessorCoreAsync(id, cpuCore); return(result ? Json(cpuCore) : ResponseResultsHelper.UpdateError()); }
public async Task <ActionResult> Create([FromBody] ProcessorInsertDto processor) { _logger.LogForModelInsert(HttpContext); var insertResult = await _processorsService.CreateProcessorAsync(processor); return(insertResult ? Json(processor) : ResponseResultsHelper.InsertError()); }
public async ValueTask <ActionResult <CaseReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var @case = await _casesService.GetCaseByIdAsync(id); return(@case == null?ResponseResultsHelper.NotFoundByIdResult(id) : Json(@case)); }
public async Task <ActionResult <CaseReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var readDto = await _videoCardCoresService.GetVideoCardCoreByIdAsync(id); return(readDto == null?ResponseResultsHelper.NotFoundByIdResult(id) : Json(readDto)); }
public async Task <ActionResult> Create([FromBody] ProcessorCoreInsertDto cpuCore) { _logger.LogForModelInsert(HttpContext); var insertResult = await _processorCoresService.CreateProcessorCoreAsync(cpuCore); return(insertResult ? Json(cpuCore) : ResponseResultsHelper.InsertError("Error when tried to insert new cpu core")); }
public async Task <ActionResult <MotherboardReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var motherboardReadDto = await _motherboardsService.GetMotherboardByIdAsync(id); return(motherboardReadDto == null ? ResponseResultsHelper.NotFoundByIdResult(id) : Json(motherboardReadDto)); }
public async Task <ActionResult <PowerSupplyReadDto> > Get([FromRoute] int id) { _logger.LogForModelRead(HttpContext, id); var powerSupplyReadDto = await _powerSuppliesService.GetPowerSupplyByIdAsync(id); return(powerSupplyReadDto == null ? ResponseResultsHelper.NotFoundByIdResult(id) : Json(powerSupplyReadDto)); }
public async ValueTask <ActionResult> Update([FromRoute] int id, [FromBody] CaseUpdateDto @case) { var result = await _casesService.UpdateCaseAsync(id, @case); if (!result) { return(ResponseResultsHelper.UpdateError()); } _logger.LogForModelUpdate(HttpContext, id); return(Json(@case)); }
public async ValueTask <ActionResult> Delete([FromRoute] int id) { var result = await _casesService.DeleteCaseAsync(id); if (!result) { return(ResponseResultsHelper.DeleteError()); } _logger.LogForModelDelete(HttpContext, id); return(Ok()); }