title: How can i create a blazor component?
body: <p>My Alert class is</p>
  <pre><code>namespace RazorComponents.Models
  {
      public class Alert
      {
          public string Title { get; set; }
          public string Text { get; set; }
          public bool Dismissible { get; set; }
      }
  }
  </code></pre>
  <p>My AlertComponent is</p>
  <pre><code>namespace RazorComponents.Test
  {
      public partial class AlertComponent : ComponentBase
      {
          public Alert Alert { get; set; }
      }
  }
  </code></pre>
  <p>with the following view</p>
  <pre><code>@using Models
    
  &lt;div class=&quot;alert alert-warning alert-dismissible fade show&quot; role=&quot;alert&quot;&gt;
      &lt;strong&gt;@Alert.Title&lt;/strong&gt; You should check in on some of those fields below.
      &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;alert&quot; aria-label=&quot;Close&quot;&gt;
          &lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;
      &lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Which returns a compile time error
  <code>C# An object reference is required for the non-static field, method, or property</code> at <code>@Alert.Title</code></p>
  <p>This is normal but how can i pass the Alert class as a model within the view?</p>
  <p>At least in MVC we had the option of <code>@model Alert</code> and pass the model through<br />
  <code>async Task&lt;IViewComponentResult&gt; InvokeAsync</code></p>