Unable to access method of child classes from a List<T> of base class.
<p>I'm creating a list of class "Task" in a way such as this.</p>

<pre><code>List&lt;Task&gt; toDoList = new List&lt;Task&gt;;
</code></pre>

<p>Task is a base class and have designed it as such:</p>

<pre><code> public class Task : IDetail
{
    string _taskName;            //Task title.
    string _taskDescription;     //Task description.

    public Task(string tn, string td) //Constructor.
    {
        _taskName = tn;
        _taskDescription = td;
    }

    // Method set or return _taskName.
    public string taskName
    {
        get
        {
            return _taskName;
        }

        set
        {
            _taskName = value;
        }
    }

    //Method to set or return _taskDescription.
    public string taskDescription
    {
        get
        {
            return _taskDescription;
        }

        set
        {
            _taskDescription = value;
        }
    }

    public virtual void editList()
    {
        Creator editCreator = new Creator();
        editCreator.Show();
    }


}
</code></pre>

<p>What i've been trying todo is call methods that exists within the inherited class like one the one i have designate "Note" and have defined it as follows.</p>

<pre><code>class Note : Task, IDetail
{
    string _noteDescription;

    public Note(string nd, string tn, string td)    //Constructor.
        : base(tn, td)
    {
        _noteDescription = nd;
    }

    //Method to set or return _noteDescription.
    public string noteDescription
    {
        get
        {
            return _noteDescription;
        }

        set
        {
            _noteDescription = value;
        }
    }

    public override void editList()
    {
        noteBuilder editNote = new noteBuilder();
        editNote.Show();
    }
}
</code></pre>

<p>However when i try to call a method of the inherited task on the list i get an error. I am trying to access the method as such:</p>

<pre><code>toDoList.ElementAt(x).noteDescription;
</code></pre>

<p>My question is how do i prevent an error from occurring?</p>

<p>the error states </p>

<p>'toDoList.Task' does not contain a definition for 'noteDescription' and no extension method etc etc.</p>

<p>Should i perhaps be  declaring the base class as Abstract? or is there something else i am missing?</p>

<p>Many thanks in advance</p>
