TMDbLib/Client/TMDbClient.cs
/// <summary>
/// Use this method to set the current client's authentication information.
/// The session id assigned here will be used by the client when ever TMDb requires it.
/// </summary>
/// <param name="sessionId">The session id to use when making calls that require authentication</param>
/// <param name="sessionType">The type of session id</param>
/// <remarks>
/// - Use the 'AuthenticationGetUserSessionAsync' and 'AuthenticationCreateGuestSessionAsync' methods to optain the respective session ids.
/// - User sessions have access to far for methods than guest sessions, these can currently only be used to rate media.
/// </remarks>
Use this method to set the current client's authentication information.
The session id assigned here will be used by the client when ever TMDb requires it.
Use this method to set the current client ' s authentication information . The session id assigned here will be used by the client when ever TMDb requires it .
public async Task SetSessionInformationAsync(string sessionId, SessionType sessionType)
        {
            ActiveAccount = null;
            SessionId = sessionId;
            if (!string.IsNullOrWhiteSpace(sessionId) && sessionType == SessionType.Unassigned)
            {
                throw new ArgumentException("When setting the session id it must always be either a guest or user session");
            }
            SessionType = string.IsNullOrWhiteSpace(sessionId) ? SessionType.Unassigned : sessionType;
            if (sessionType == SessionType.UserSession)
            {
                try
                {
                    ActiveAccount = await AccountGetDetailsAsync().ConfigureAwait(false);
                }
                catch (Exception)
                {
                    ActiveAccount = null;
                    SessionId = null;
                    SessionType = SessionType.Unassigned;
                    throw;
                }
            }
        }
public async Task SetSessionInformationAsync ( string sessionId , SessionType sessionType ) { ActiveAccount = null ; SessionId = sessionId ; if ( ! string . IsNullOrWhiteSpace ( sessionId ) && sessionType == SessionType . Unassigned ) { throw new ArgumentException ( " " ) ; } SessionType = string . IsNullOrWhiteSpace ( sessionId ) ? SessionType . Unassigned : sessionType ; if ( sessionType == SessionType . UserSession ) { try { ActiveAccount = await AccountGetDetailsAsync ( ) . ConfigureAwait ( false ) ; } catch ( Exception ) { ActiveAccount = null ; SessionId = null ; SessionType = SessionType . Unassigned ; throw ; } } }
Use this method to set the current client's authentication information.
Use this method to set the current client ' s authentication information .
// Populate the related account information // Unable to complete the full process so reset all values and throw the exception
sessionId
string
The session id to use when making calls that require authentication
The session id to use when making calls that require authentication
sessionType
SessionType
The type of session id
The type of session id
remarks
Use the 'AuthenticationGetUserSessionAsync' and 'AuthenticationCreateGuestSessionAsync' methods to optain the respective session ids.
User sessions have access to far for methods than guest sessions, these can currently only be used to rate media.
Use the ' AuthenticationGetUserSessionAsync ' and ' AuthenticationCreateGuestSessionAsync ' methods to optain the respective session ids . User sessions have access to far for methods than guest sessions these can currently only be used to rate media .