Does not contain a definition for and no extension method accepting a first argument of type could be found

前端 未结 3 1022
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-11 18:37

I\'ve looked around at some of the solutions to this problem but they don\'t seem to be the same as what I\'m experiencing.

Method that I\'m trying to call:

相关标签:
3条回答
  • 2021-01-11 19:23

    Declare an instance of the CBetfairAPI class or make it static.

    0 讨论(0)
  • 2021-01-11 19:26

    There are two cases in which this error is raised.

    1. You didn't declare the variable which is used
    2. You didn't create the instances of the class
    0 讨论(0)
  • 2021-01-11 19:32

    placeBets(betList, stakeAmt) is an instance method not a static method. You need to create an instance of CBetfairAPI first:

    MyBetfair api = new MyBetfair();
    ArrayList bets = api.placeBets(betList, stakeAmt);
    
    0 讨论(0)
提交回复
热议问题