1

The solidity code

pragma solidity ^0.4.24;
event NewEvent(uint32 tag, uint32 idx);

My Nethereum code

public class NewEventDTO
{
    [Parameter("uint32", "tag", 1, false)]
    public uint Tag { get; set; }

    [Parameter("uint32", "idx", 2, false)]
    public uint Index{ get; set; }
}

var w = new Web3(mNodeUrl);
var c = w.Eth.GetContract(mAbi, mAdd);
var eNew = c.GetEvent("NewEvent");
var fNew = eNew.CreateFilterAsync().Result;

var en = eNew.GetFilterChanges<NewEventDTO>(fNew).Result; // ** Error

There is no reason for the code above to fail. But it kept on complaining "NewEventDTO is not a valid Event Type"

Hope someone can shed some light in this issue.

Is there any changes in Nethereum where I need to derive my DTO from a specific class?

2

I have found the answer myself after downloading Nethereum source code and trying to debug myself.

The latest version requires us to put the [Event()] attribute for Event DTO

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.