How can I top up the number of elements in a list to make it equal to ten?
<p>I have a City class and inside that a Detail class:</p>

<pre><code>public class City {

        public string PartitionKey { get; set; }
        public string RowKey { get; set; }
        public string Notes { get; set; }

        public class Detail
        {
            public Detail()
            {
                ImageFile = String.Empty;
                Explanation = new HtmlText();
            }
            public string ImageFile { get; set; }
            public HtmlText Explanation { get; set; }
        }

}
</code></pre>

<p>In my code I have some lines that check how many details there are and if there are less than ten then I add new City.Details. I am using the code below to do this but it's located in a few different methods and does not look clean. Is there some way that I could simplify this and also add the logic of checking, counting and adding into my base City class?</p>

<pre><code>foreach (int index in Enumerable.Range(0, 10 - vm.Details.Count()))
            {
                vm.Details.Add(new City.Detail());
            }
</code></pre>
