private static bool IsStatusOK(TmeApi tmeApi, string jsonContent) { ErrorJResult errorResult = null; if (!tmeApi.IsStatusOK(jsonContent, out errorResult)) { Console.WriteLine($"Api returns error:"); Console.WriteLine(); Console.WriteLine($"Status: {errorResult.Status}"); Console.WriteLine($"Error: {errorResult.Error}"); return(false); } return(true); }
public bool IsStatusOK(string jsonContent, out ErrorJResult errorResult) { JObject json = JObject.Parse(jsonContent); string status = json["Status"].ToString(); if (status == "OK") { errorResult = null; return(true); } else { errorResult = new ErrorJResult(status, json["Error"].ToString()); return(false); } }