How can i get list of dates between start and end dates using linq or lambda expression.
DateTime StartDate = DateTime.Now;
DateTime EndDate = DateTime.Now.AddMonths(13);
List<DateTime> ListofDates = //Contains list of all dates only between start and end date.
First of all, when you want
Datesand notDatetimesyou better useDateTime.Now.Dateinstead of justDateTime.NowI’ve edited SLaks code so you can get the list of dates you want.
Note that I’ve added
+1in the enumerable so you can have both thestartandenddate (you didn’t specify it)