title: Blazor: name does not exist in current context
body: <p>I am receiving an error of CS0103 - 'The name 'newHotel' does not exist in the current context':</p>
  <p>I've created a class called 'Hotel', and a property called 'HotelName'. <br>
  I've created a variable called 'newHotel', which is of type Hotel.<br>
  And I have initialised the variable with a value of &quot;Paradise Beach&quot;.<br></p>
  <pre><code>@page &quot;/hotels&quot;
  
  
  &lt;h3&gt;Hotels&lt;/h3&gt;
  &lt;p&gt;
      Hotel Name: @newHotel.HotelName // **THIS IS WHERE THE ERROR IS SHOWN IN VS2019**
  &lt;/p&gt;
  </code></pre>
  <p>Remaining code:</p>
  <pre><code>@code {
  
      protected override void OnInitialized()
      {
          base.OnInitialized();
  
          Hotel newHotel = new Hotel 
          {
              HotelName = &quot;Paradise Beach&quot;
          };
      }
  
      class Hotel
      {
          public string HotelName { get; set; }
      }
  }
  </code></pre>
  <p>I can't tell where I am going wrong?</p>
  <p>Many thanks,</p>