コード例 #1
0
        public void Dispose()
        {
            //Delete created signature:
            var createdSignature = _signatureService.GetById(new Guid("e47c0cb5-05b6-437d-b40f-f2c5b5a08385"));

            if (createdSignature != null && createdSignature.Id != Guid.Empty)
            {
                _signatureService.Delete(createdSignature);
            }

            //Recovery modified signature:
            var modifiedSignature = _signatureService.GetById(new Guid("EED7F976-58B7-4C05-E3E4-08D6F9F0FC2C"));

            if (modifiedSignature != null && modifiedSignature.Id != Guid.Empty)
            {
                modifiedSignature.Name = "Signature 1";
                _signatureService.Update(modifiedSignature);
            }
        }
コード例 #2
0
 public IActionResult GetSignatureById(Guid id)
 {
     try
     {
         var signature = _signatureService.GetById(id);
         if (signature.IsEmptyObject())
         {
             _logger.LogError($"Signature with id: {id}, hasn't been found in db.");
             return(NotFound());
         }
         else
         {
             _logger.LogInfo($"Returned signature with id: {id}");
             return(Ok(signature));
         }
     }
     catch (Exception ex)
     {
         _logger.LogError($"Something went wrong inside GetSignatureById action: {ex.Message}");
         return(StatusCode(500, "Internal server error"));
     }
 }