6
Answers

List Item and Initialization

Naji

Naji

3d
70
1

Hello,

Will both statements below produce the same result?  I am using new in the first example but the second does not have new. The code will be used inside a for loop.

 

CatDayPerList listItem = new CatDayPerList();
 listItem = CDPL.FirstOrDefault(i => i.DayPerc == item.DayPerc);

   OR

 CatDayPerList listItem = CDPL.FirstOrDefault(i => i.DayPerc == item.DayPerc);

 

Answers (6)