【问题标题】:Cannot convert method group to non-delegate type无法将方法组转换为非委托类型
【发布时间】:2013-03-05 13:12:19
【问题描述】:
var deletedItems = tmpData.FindAll(qr => (Int32)qr.YearQuarter < (Int32)useDate.YearQuarter);'

userdate.yearquarter

<Extension()>
  Public Function YearQuarter(currentDate As Date) As Integer
    Return Library.Dates.ToYearQuarter(currentDate)
  End Function

我在这里遇到错误:

"< (Int32)useDate.YearQuarter;"

【问题讨论】:

    标签: asp.net


    【解决方案1】:

    你没有正确调用YearQuarter;你需要做YearQuarter(DateObject)。如果没有括号,您将尝试传递代表函数的 method group - 而不是函数的返回值。

    【讨论】:

      猜你喜欢
      • 2015-12-24
      • 1970-01-01
      • 1970-01-01
      • 2013-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-23
      • 1970-01-01
      相关资源
      最近更新 更多