public async Task <ActionResult> UpdateProtocol(int id, ProtocolUpdateDto protocolUpdateDto) { var protocol = await _protocolRepository.GetProtocol(id); protocol.ProtocolName = protocolUpdateDto.ProtocolName; protocol.ModifiedAt = protocolUpdateDto.ModifiedAt; _protocolRepository.Update(protocol); return(NoContent()); }
public async Task <CreateProtocolResponse> CreateOrUpdateProtocolAsync(Protocol protocol) { // TODO :: CHECK IF SUBTEST BELONGS TO TOKEN USER'S TESTS //https://stackoverflow.com/questions/46112258/how-do-i-get-current-user-in-net-core-web-api-from-jwt-token if (protocol.Id == 0) { _protocolRepository.Add(protocol); } else { _protocolRepository.Update(protocol); } await _unitOfWork.CompleteAsync(); return(new CreateProtocolResponse(true, null, protocol)); }
public bool Update(Protocol model, int key) => protocolRepository.Update(model, key);
public IActionResult UpdateProtocol([FromBody] Protocol model) { _repo.Update(model); return(new OkObjectResult(new { ProtocolId = model.ProtocolId })); }