I need to expose a singleton shared object across all controllers/action methods in Asp.Net WebAPI. Which is the best place to declare such global static objects so that all co
You can declare variable inside your WebApiApplication (Global.asax.cs) and use it in all controllers with code:
var globalValue = (HttpContext.Current.ApplicationInstance as WebApiApplication).GlobalVariableName;
But as for me it's not the best way, because you'll get overhead with initialization and setting value and also it looks like some architecture issue.
Why do you need global object? If it some function just declare new parent controller and declare this function in it. If you need read only data - put it into web.cofig.