private string GetMessageFromAdditionalProperties() { if (AdditionalProperties == null) { return("Generic error"); } if (AdditionalProperties.TryGetValue("error", out object data)) { var error = JsonConvert.DeserializeObject <OperationError>(data.ToString()); return(error.Message); } if (AdditionalProperties.TryGetValue("message", out data)) { return(data.ToString()); } return("Generic message"); }
/// <summary> /// Get the value of a key like "value" or return null if not found. /// </summary> /// <param name="key">The name of the key to lookup.</param> /// <returns>The value of the key or null.</returns> private object GetValue(string key) => AdditionalProperties.TryGetValue(key, out object value) ? value : null;