title: Can a blazor parameter be an object with only the getter's for properties exposed?
body: <p>I am implementing something similar to <a href="https://docs.microsoft.com/en-us/aspnet/core/blazor/security/server/additional-scenarios?view=aspnetcore-3.1#pass-tokens-to-a-blazor-server-app" rel="nofollow noreferrer">Pass tokens to a Blazor Server app</a></p>
  <p>I have an object that I pass from _host to app.razor.</p>
  <p>Due to pre-render, the OnInit logic is called twice.</p>
  <p>The first time, the values in the object are as expected.  The second render, the values in the object are the default values.</p>
  <p>After a bit of trial-and-error, I discovered that the problem is that I had protected the object properties (ex: public string AValue { get; }) and and populated the props through the constructor.</p>
  <p>Even if I change the props to be {get; private set;}, the behavior is the same.</p>
  <p>The only way that I can get this to work right is to make the props full public get/set.</p>
  <p>I really didn't want to do expose the set methods on these prop's as I like to make these objects immutable (as much as you can within c#)</p>
  <p>questions:</p>
  <ol>
  <li>Any doc's that describe this or other limitations when passing parameters into razor component?</li>
  <li>Is this just a problem with the _host/app.razor parameter passing, or is it something that would affect any component parameter passing?</li>
  </ol>