The problem
I have an api GET method to retrieve site configuration. I am using httpClient
and the GetAsync()
method to do this.
HttpResponseMessage response = await client.GetAsync("api/{0}/config", id);
As I need this configuration across the site, I planned to use a global action filter for this.
Question
How can I call an async method in an MVC action filter? Or is there a better solution to this problem?
I have looked at multiple SO questions (Async action filter in MVC 4) on this but I not found a satisfactory solution.