How to fill list with two columns in C#
<p>I have data in SQL Server database, I'm fetching data in string format.</p>

<p>Data looks like this: </p>

<pre><code>08:00,11:00|11:00,13:00|13:00,16:00|
</code></pre>

<p>We see, the string is separated by commas and pipes.</p>

<p>Comma-separated values are Start &amp; End Time Slots where as pipe-separated values are different time slots.</p>

<p>Class in C#</p>

<pre><code>public string _TimeSlots { get; set; }  

public class TimeSlots 
{
    public string StartSlot { get; set; }
    public string EndSlot { get; set; } 
}
</code></pre>

<p>I tried this:</p>

<pre><code>public List{TimeSlots} TimeSlotList
{
    get { return _TimeSlots.Split(',').Select(DateTime.Parse).ToList();}
    set { TimeSlots = _TimeSlots.Remove(_TimeSlots.Length - 1); }
}
</code></pre>

<p>How to fill list with two columns in C#?</p>