Beispiel #1
0
        /// <summary>
        /// Decode token to a dictionary
        /// </summary>
        /// <param name="tokenOption">Token option</param>
        /// <returns>Return dictionary value</returns>
        public static Dictionary <string, object> DecodeToDictionary(TokenOption tokenOption)
        {
            var tokenEngine = GetTokenEngine(tokenOption?.TokenType ?? string.Empty);

            return(tokenEngine.DecodeToDictionary(tokenOption));
        }
Beispiel #2
0
        /// <summary>
        /// Decode token to object
        /// </summary>
        /// <typeparam name="T">Data type</typeparam>
        /// <param name="tokenOption">Token option</param>
        /// <returns>Return data object</returns>
        public static T DecodeToObject <T>(TokenOption tokenOption)
        {
            var tokenEngine = GetTokenEngine(tokenOption?.TokenType ?? string.Empty);

            return(tokenEngine.DecodeToObject <T>(tokenOption));
        }
Beispiel #3
0
        /// <summary>
        /// Encode
        /// </summary>
        /// <param name="tokenOption">Token option</param>
        /// <returns>Return the token value</returns>
        public static TokenValue Encode(TokenOption tokenOption)
        {
            var tokenEngine = GetTokenEngine(tokenOption?.TokenType ?? string.Empty);

            return(tokenEngine.Encode(tokenOption));
        }