コード例 #1
0
        public async Task <IActionResult> CreateTestCondition([FromBody] TestIssueResource testIssueResource)
        {
            var testIssue = _mapper.Map <TestIssueResource, TestIssue>(testIssueResource);

            _repository.Add(testIssue);
            await _unitOfWork.CompleteAsync();

            var result = _mapper.Map <TestIssue, TestIssueResource>(testIssue);

            return(Ok(result));
        }
コード例 #2
0
        public async Task <IActionResult> UpdateTestCase(long testIssueId, [FromBody] TestIssueResource testIssueResource)
        {
            var testIssue = await _repository.Get(testIssueId);

            if (testIssue == null)
            {
                return(NotFound());
            }

            var result = _mapper.Map <TestIssueResource, TestIssue>(testIssueResource, testIssue);

            _repository.Update(result);
            await _unitOfWork.CompleteAsync();

            return(Ok(result));
        }