Esempio n. 1
0
        public static TToken Create <TToken>(byte[] byteArray) where TToken : class, IToken
        {
            NullGuard.NotNull(byteArray, nameof(byteArray));

            if (typeof(TToken) == typeof(IRefreshableToken))
            {
                return(DomainHelper.FromByteArray <RefreshableToken>(byteArray) as TToken);
            }

            if (typeof(TToken) == typeof(IToken))
            {
                return(DomainHelper.FromByteArray <Token>(byteArray) as TToken);
            }

            return(DomainHelper.FromByteArray <TToken>(byteArray));
        }
Esempio n. 2
0
 public T ToObject <T>() where T : class
 {
     return(DomainHelper.FromByteArray <T>(Value));
 }