Initializing a List c#
<pre><code>List&lt;Student&gt; liStudent = new List&lt;Student&gt;
        {
            new Student
            {
                Name="Mohan",ID=1
            },
            new Student
            {
            Name="Ravi",ID=2

            }
        };
public class Student
{
    public string Name { get; set; }
    public int ID { get; set; }

}
</code></pre>

<p>Is there other way to write this? I am a newbie. I want to make instance of student class first and assign properties in list.</p>
