title: How to continue numbering a list from where it stops?
body: <p>I'm reading content from some API, and the content may come as either come as "paragraph" or "ordered list". </p>
  
  <p>My list order is always restarting numbering every time it reads a new record. 
  Example
  1.TEST
  1.TEST</p>
  
  <p>My goal is to display the content as follows
  1.TEST
  2.TEST
  even after reading different content in between</p>
  
  <pre><code>@foreach (var x in item.copy)
          {
              if (x.type == "o-list-item")
              {
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;ol&gt;
                          &lt;li&gt;
                              @Html.DisplayFor(modelItem =&gt; x.text)
                          &lt;/li&gt;
                      &lt;/ol&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              }
              else if(x.type== "paragraph")
              {
              &lt;tr&gt;
                  &lt;td&gt;
                          @Html.DisplayFor(modelItem =&gt; x.text)
                  &lt;/td&gt;
              &lt;/tr&gt;
              }
          }
  </code></pre>
  
  <p>I understand that if the list sequence is interrupted, then it is a new list sequence, and can’t be a continuation of a previous list.
  But, I have to make it, and </p>
  
  <p>I tried to custom code myself, by concatenating an integer count=1 and increment when the for loop reads "o-list-item" type of content, but the DisplayFor razor view seems not allowing to concatenate any custom made variables.</p>
  
  <pre><code> @foreach (var x in item.copy)
      {
          if (x.type == "o-list-item")
          {
           int count=1;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;ol&gt;
                      &lt;li&gt;
                          count + "."+ @Html.DisplayFor(modelItem =&gt; x.text)
                          count ++;
                      &lt;/li&gt;
                  &lt;/ol&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          }
          else if(x.type== "paragraph")
          {
          &lt;tr&gt;
              &lt;td&gt;
                      @Html.DisplayFor(modelItem =&gt; x.text)
              &lt;/td&gt;
          &lt;/tr&gt;
          }
      }
  </code></pre>
  
  <p>Any help please</p>