I have an asp.net web-api2
application which is using COM object
for interacting with data.
I have an Engine
object that is working with it. Like this:
public class PVXEngine : IDisposable
{
protected DispatchObject _pvxObject;
public PVXEngine()
{
_pvxObject = new DispatchObject("ProvideX.Script");
}
public void Dispose()
{
_pvxObject.Dispose();
}
}
I don't want to recreate this object for every request. How can i store my PVXEngine
in my Application Context to not recreate it. ( I guess it will be disposed when Application Pool Recyles. )
Also if it is possible, refer me documentation where I can read about caching objects in Application Pool.
Thank you for your time.