In a ASP.net MVC application we read text content from MongoDb which we are showing in razor views like this.
<span>@Html.T("WelomeText")</span>
This calls a method with a s signature like this:
Task<string> GetLocalizedTextAsync(string key)
this method read asynchoronously from mongo db. In order to make the call synchronous the call looks like this
var result = GetLocalizedTextAsync().Result;
What is the best way to make a method synchronous for HTML Helper? Currently we are assumim that his method is related to some hangs of the an asp application