问题:以下代码是否100%确保每个用户的对象的唯一性(根据我的理解,这意味着每个浏览器(或请求))?
/// <summary>
/// Ensures the uniqueness for each request.
/// </summary>
private static MultiLanguageProvider Instance
{
get
{
var currentSession = HttpContext.Current.Session;
var nameOfInstance = nameof(MultiLanguageProvider);
if ((currentSession[nameOfInstance] as MultiLanguageProvider).IsNull())
currentSession[nameOfInstance] = new MultiLanguageProvider();
return currentSession[nameOfInstance] as MultiLanguageProvider;
}
}