C
C#2y ago
.bobgoblin

❔ Issue With Code

I have this code
public T Deserialize<T>(IRestResponse response)
{
try
{
return JsonConvert.DeserializeObject<T>(response.Content, _settings);
}
catch
{
}

return default(T);

}
public T Deserialize<T>(IRestResponse response)
{
try
{
return JsonConvert.DeserializeObject<T>(response.Content, _settings);
}
catch
{
}

return default(T);

}
and the IRestResponse should resolve to interface IRestResponse but I'm getting an error even tho I have added using RestSharp; What do I need to change/alter so this code works correctly?
7 Replies
ero
ero2y ago
what error
.bobgoblin
.bobgoblinOP2y ago
interesting...I was using the most recent Rest Sharp nuget package, I downgraded it to 106.12.0 and the issue is resolved. ohhh, i didn't realize i forgot the error
ero
ero2y ago
IRestResponse appears to be deprecated
The IRestResponse interface is deprecated. You get an instance of RestResponse or RestResponse<T> in return.
.bobgoblin
.bobgoblinOP2y ago
ah - that would explain it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
.bobgoblin
.bobgoblinOP2y ago
lol - certainly not. One of those things to change, but just trying to get this puppy into GitHub atm
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server