public async void CreateCSKeys() { var keys = new CognitiveServiceKeysDto() { WorkspaceKey = "b798ac78-acf5-44e9-a405-46a85736fd8e", FaceApiKey = "73a191f1899e44ff9f14be1c81e9e7b7", EmotionApiKey = "837be46e535547ec8892f7fdf5cf1645" }; var result = await _service.CreateCognitiveServiceKeys(keys); Assert.Equal(true, result); }
public async Task <IActionResult> CreateCognitiveServiceKeys([FromBody, Required] CognitiveServiceKeysDto csKeysDto) { try { if (csKeysDto == null) { return(BadRequest()); } var result = await _service.CreateCognitiveServiceKeys(csKeysDto); return(CreatedAtRoute("default", result)); } catch (Exception ex) { Log.Error(ex, ex.Message); return(BadRequest(ex.Message)); } }