Assigning to an IList< > or a List< >?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8717582/why-use-ilist-or-list">why use IList or List?</a>  </p>
</blockquote>



<p>I have the following:</p>

<pre><code>public class CityViewModel
{
    public CityViewModel() {     
        Details = Enumerable.Range(1,10).Select(x =&gt; new City.Detail()).ToList(); 
    }
    public string Topic { get; set; }
    public City City { get; set; }
    public IList&lt;City.Detail&gt; Details { get; set; }
}
</code></pre>

<p>The suggestion as a way to create Details was given to me. What I am unsure about is why the following line is declared as an IList:</p>

<pre><code>public IList&lt;City.Detail&gt; Details { get; set; }
</code></pre>

<p>Would it not be more correct to declare this as:</p>

<pre><code>public List&lt;City.Detail&gt; Details { get; set; }
</code></pre>

<p>Can someone explain the difference to me.</p>
