title: Updating variable in Foreach
body: <p>I'm trying to update a variable with the following way:</p>
  
  <pre><code>@{ double totalPrice = 0;}
  
  @foreach (var item in Model)
  {
  
         @{totalPrice += item.Price; }
  }
  </code></pre>
  
  <p>I'm not sure if it is possible.. If so, what is the right syntax?</p>