Using the latest version of RestSharp
and the documentation states
Do not instantiate RestClient for each HTTP call. RestSharp creates a new instance of HttpClient internally, and you will get lots of hanging connections, and eventually exhaust the connection pool.
Therefore i already have a Base class which cant be changed that is used by all my MVC Controllers.
I thought i could create my own class but this would mean everytime a page makes a request it would create another instance as i would need to instantiate a new instance.
How could i instantiate a single RestClient
so if i have 10 pages making a call it utilises the one instance as per the documentation?
Any examples would be great.