-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I have been doing this in the application/project that uses the Utility.BaseClasses, but this would really be good to do within the library instead.
I would like to parse this without Newtonsoft due to the fact that it adds Newtonsoft as a dependancy.
public static Utility.BaseClasses.Error IsError(string json)
{
Utility.BaseClasses.Error returnValue = new Utility.BaseClasses.Error();
try
{
if (json.Contains("Message") && json.Contains("Status"))
{
returnValue = Newtonsoft.Json.JsonConvert.DeserializeObject<Utility.BaseClasses.Error>(json);
}
}
catch
{
//suppressing the error because we are just using this as a checkpoint
returnValue = new Utility.BaseClasses.Error();
}
return returnValue;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels