How can I use incrementCounter from c# SDK

You could be right. Perhaps because otherwise

ctx.data.id is not a valid object and the assignment does not work. I will write a test for that.

I actually had a test for this and also tested it with postman:

The script:

The request:

The result: