public async Task <IActionResult> CategoryAdd(string system, string name) { _logger.LogDebug($"New category ({name}) is requested"); var sysrec = await _dbHandler.GetSystemAsync(system); var respond = await _dbHandler.AddCategoryAsync(name, sysrec); if (respond.MessageType == MessageType.NOK) { _logger.LogWarning($"{respond.MessageText}"); GeneralMessage ret = new GeneralMessage(); ret.Message = respond.MessageText; return(BadRequest(ret)); } var data = await _dbHandler.GetCategoryAsync(name, sysrec); _logger.LogInformation($"New category ({name}) request is completed"); return(Ok(data)); }