This is not possible with standard functionality. For example "file://" URLs do not work with RestSharp.
I would recommend using RestSharp do get the returned data from a Uri and having another function to deserialize this data into an object.
You can use the same funcion then to deserialize from file data.
RestSharp is a library to do REST calls, not to deserialize from arbitrary sources. Even if there is a possibility to make RestSharp believe it is talking to a website instead of a file, it would be a hack.
If you need it you could still use the XmlDeserializer
from RestSharp. It expects a IRestResponse
object, but it only uses the Content
property from it, so it should be easy to create. It still feels like a hack though and there are more than enough other XmlSerializers
out there that will do a great job