Пример #1
0
        public async Task <IActionResult> ActivateInquiryAsync([FromBody] int id)
        {
            try
            {
                _logger.LogDebug("Activating inquiry Part");
                bool success = await _inquiryService.ActivateAsync(id);

                if (success)
                {
                    _logger.LogDebug("inquiry part updated.");
                    return(Ok("inquiry part updated successfully"));
                }
                else
                {
                    _logger.LogDebug("Update failed. Inquiry Part not Found");
                    return(Conflict("Inquiry part not found"));
                }
            }
            catch (Exception ex)
            {
                //log
                _logger.LogError("An Exception occured: {ex}", ex.Message);
                _logger.LogError("Stack Trace: {ex}", ex.StackTrace);
                return(BadRequest());
            }
        }