简体   繁体   English

如何使用nethereum运行此智能合约功能以返回结果?

[英]How do I run this smart contract function using nethereum to return a result?

I followed a great article online to create a smart contract with CRUD operations. 我在网上关注了一篇很棒的文章,使用CRUD操作创建了智能合约。

This is the function I can't get working: 这是我无法使用的功能:

function getUserAtIndex(uint index)
    public
    constant
    returns(bytes32 userKey)
  {
    return userIndex[index];
  }

I've deployed the contract and can get the function using: 我已经部署了合同,可以使用以下命令获取功能:

  var getUserAtIndex = contract.GetFunction("getUserAtIndex");

I want to know how I can use this to get the user details at that index by using that function? 我想知道如何使用该函数来使用该索引来获取该索引处的用户详细信息?

Thank You. 谢谢。

像这样吗

var result = getUserAtIndex.CallAsync<byte[]>(123);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Nethereum 调用 BSC 合约 function 不断产生相同(不正确)的结果 - Calling BSC contract function with Nethereum keeps producing the same (incorrect) result 使用 Nethereum 订阅合约事件 - Subscribe to contract events using Nethereum Nethereum 调用币安智能链合约 function like balanceOf 或通过 Blazor WebAssembly 转账 - Nethereum Call Binance Smart Chain contract function like balanceOf or transfer via Blazor WebAssembly 如何使用 Nethereum 创建以太坊 HD 钱包实现 - How do I create an Ethereum HD wallet implementation with Nethereum 如何使用 web3gl 将合约发送到智能合约 - How to send contract using web3gl to smart contract 将交易发送到已部署的智能合约需要很长时间。 (Nethereum + Unity) - It takes too long to send transaction to the smart contract which is already deployed. (Nethereum + Unity) 如何使用MVC WebApi 4返回空结果 - How do I return an empty result using MVC WebApi 4 我如何使用 Nethereum 从原始交易中提取链 ID? - How do I use Nethereum to extract Chain Id from a raw transaction? 如何从该线程返回结果? - How do I return a result from this thread? 我应该为任何方法结果做Contract.Ensures吗? - Should I do Contract.Ensures for any method result?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM