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 IActionResult AddProtocol([FromBody] Protocol model) { _repo.Add(model); return(new OkObjectResult(new { ProtocolId = model.ProtocolId })); }