private (TransactionToken TransactionToken, dynamic Payload) ResolveRequestTx(ByteString byteString)
        {
            var transactionToken = TransactionToken.FromByteString(byteString);

            var     baseTransaction = JsonConvert.DeserializeObject <BaseTransaction>(Encoding.UTF8.GetString(transactionToken.Data), _transactionSerializerSettings);
            dynamic payload         = Convert.ChangeType(baseTransaction, baseTransaction.GetType());

            return(transactionToken, payload);
        }
コード例 #2
0
        private (ITransactionHandler Handler, TransactionToken TransactionToken, BaseTransaction Payload) ResolveTransactionHandler(Func <ByteString> byteStringAccessor)
        {
            var byteString       = byteStringAccessor();
            var transactionToken = TransactionToken.FromByteString(byteString);

            var payload = JsonConvert.DeserializeObject <BaseTransaction>(Encoding.UTF8.GetString(transactionToken.Data), _transactionSerializerSettings);

            return(_transactionHandlerFactory.CreateHandlerFor(payload), transactionToken, payload);
        }