How to get all weekends within date range in C# [closed]
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 5 years ago . I am just wondering if there is a simple way or framework to to get all weekends within date range in C#? Is it possible to do with LINQ as well? Any clue? Thank you! If you make a way to enumerate all days, you can use linq to filter to weekends: IEnumerable<DateTime> GetDaysBetween(DateTime start, DateTime end) { for (DateTime i = start; i < end; i = i.AddDays(1)) { yield