どの 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.Userhttp コンテキストが利用可能な場合。CodeFluentUserIdentityType.Windowsそれ以外はAspNetOrWindows:HttpContext.Current.Userhttp コンテキストが使用可能で、ユーザーが認証されている場合。CodeFluentUserIdentityType.Windowsそれ以外はCurrent:Thread.CurrentPrincipal.IdentityCurrentOrWindows:Thread.CurrentPrincipal.Identity認証時。CodeFluentUserIdentityType.Windowsそれ以外は
あなたの答えによると、AspNet の意味は次のとおりです
HttpContext.Current.User。http コンテキストが利用可能な場合。CodeFluentUserIdentityType.Windowsそれ以外は
ただし、ドキュメントによれば、AspNet の意味は次のとおりです。
コンテキストが ASP.NET の場合、HttpContext.Current.User.Identity が使用されます。それ以外の場合は、Thread.CurrentPrincipal.Identity が使用されます。
ドキュメントはこれについて正しいと思いますか?