Minumum value of a list isn't compariable with a double value
if (b.B开发者_开发知识库ooksList[ID].BookPrices.Min== b.BooksList[ID].BookPrices[i])
cannot be compared. BookPrices[]
is a list of doubles.
Error:
Error 11 Operator '==' cannot be applied to operands of type 'method group' and 'double'
You forgot the parenthesis on your call to Min()
.
Whenever the words "method group" appear in an error message, it's time to go looking for missing parenthesis on a function call.
Try
if (b.BooksList[ID].BookPrices.Min()== b.BooksList[ID].BookPrices[i])
精彩评论