本文整理汇总了C#中IAuthSession.ThrowIfNull方法的典型用法代码示例。如果您正苦于以下问题:C# IAuthSession.ThrowIfNull方法的具体用法?C# IAuthSession.ThrowIfNull怎么用?C# IAuthSession.ThrowIfNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAuthSession
的用法示例。
在下文中一共展示了IAuthSession.ThrowIfNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadUserAuth
public void LoadUserAuth(IAuthSession session, IAuthTokens tokens)
{
session.ThrowIfNull("session");
var userAuth = GetUserAuth(session, tokens);
LoadUserAuth(session, (UserAuth)userAuth);
}
示例2: LoadUserAuth
/// <summary>
/// Load the user auth based on the session.
/// </summary>
/// <param name="session">The session.</param>
/// <param name="tokens">The tokens.</param>
/// <exception cref="ArgumentException">
/// Exception thrown if session is null.
/// </exception>
public void LoadUserAuth(IAuthSession session, IAuthTokens tokens)
{
session.ThrowIfNull("session");
var userAuth = this.GetUserAuth(session, tokens) as LightSpeed.UserAuth;
if (userAuth == null)
{
return;
}
// Re-populate the session
var sessionId = session.Id;
session.PopulateWith(userAuth);
session.Id = sessionId;
session.UserAuthId = userAuth.Id.ToString(CultureInfo.InvariantCulture);
session.ProviderOAuthAccess =
this.GetUserAuthDetails(session.UserAuthId)
.ConvertAll(x => (IAuthTokens)x);
}
开发者ID:hhandoko,项目名称:ServiceStack.Authentication.LightSpeed,代码行数:27,代码来源:LightSpeedUserAuthRepository.cs