I have a situation where I want to convert a row of data that spans multiple days into multiple objects.
namespace Linq
{
class Program
{
static void Main(string[] args)
{
var item = new List<Item>
{
new Item {StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(2)},
new Item {StartDate = DateTime.Now, EndDate = DateTime.Now.AddMinutes(120)}
};
}
}
}
public class Item
{
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
For the output I would like this:
As the first row spans two days I want two rows for Row1
Row1, 21/04/2016
Row1, 22/04/2016
Row2, 21/04/2016
Hope this makes sense?