Simple program to demonstrate min or empty collection

Amatya
Posted by Amatya under Error and Solution category on | Points: 40 | Views : 173
Simple program to demonstrate min or empty collection
var numbers = new List<int>();  // empty list
int minNumber = numbers.Min();


Result: throws InvalidOperationException

Thanks
Amatya

Comments or Responses

Login to post response