どの ID をCodeFluent.Runtime.CodeFluentUser.Current
使用しますか? またはを使用しますHttpContext.Current.User.Identity
かThread.CurrentPrincipal.Identity
?または、フォールバックメカニズムを使用していますか?
2 に答える
CodeFluentUser.Current
を呼び出しますCodeFluentUser.Get(CodeFluentUserIdentityType.CurrentOrWindows)
。を使用する場合CodeFluentContext.User
、ID タイプは構成ファイルで設定できます (デフォルトではuserIdentityType="AspNetOrWindows"
)
それぞれのドキュメントは次のCodeFluentUserIdentityType
とおりです。
Windows
:WindowsIdentity.GetCurrent()
AspNet
:HttpContext.Current.User
http コンテキストが利用可能な場合。CodeFluentUserIdentityType.Windows
それ以外はAspNetOrWindows
:HttpContext.Current.User
http コンテキストが使用可能で、ユーザーが認証されている場合。CodeFluentUserIdentityType.Windows
それ以外はCurrent
:Thread.CurrentPrincipal.Identity
CurrentOrWindows
:Thread.CurrentPrincipal.Identity
認証時。CodeFluentUserIdentityType.Windows
それ以外は
あなたの答えによると、AspNet の意味は次のとおりです
HttpContext.Current.User
。http コンテキストが利用可能な場合。CodeFluentUserIdentityType.Windows
それ以外は
ただし、ドキュメントによれば、AspNet の意味は次のとおりです。
コンテキストが ASP.NET の場合、HttpContext.Current.User.Identity が使用されます。それ以外の場合は、Thread.CurrentPrincipal.Identity が使用されます。
ドキュメントはこれについて正しいと思いますか?