0

どの ID をCodeFluent.Runtime.CodeFluentUser.Current使用しますか? またはを使用しますHttpContext.Current.User.IdentityThread.CurrentPrincipal.Identity?または、フォールバックメカニズムを使用していますか?

4

2 に答える 2

0

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.Identity

  • CurrentOrWindows:Thread.CurrentPrincipal.Identity認証時。CodeFluentUserIdentityType.Windowsそれ以外は

于 2016-04-14T09:42:51.113 に答える
0

あなたの答えによると、AspNet の意味は次のとおりです HttpContext.Current.User。http コンテキストが利用可能な場合。CodeFluentUserIdentityType.Windowsそれ以外は

ただし、ドキュメントによれば、AspNet の意味は次のとおりです。

コンテキストが ASP.NET の場合、HttpContext.Current.User.Identity が使用されます。それ以外の場合は、Thread.CurrentPrincipal.Identity が使用されます。

ドキュメントはこれについて正しいと思いますか?

于 2016-06-14T12:04:50.127 に答える