How pass objects from one page to another on ASP.Net Core with razor pages? : <p>I'm developing a web application using Asp.net core 2.0 with razor pages. I'm creating an object with some data and want to send that object to another page.</p>

<p>Actually I'm doing this:</p>

<pre><code>var customObject = new{
   //some values
};
return RedirectToPage("NewPage", customObject);
</code></pre>

<p>I see that the url has the values of the object I'm sending, but I can't find how to take that values (in the NewPage instance).</p>

<p>Can anybody knows how to share objects between razor pages? Is this the correct way to achieve it? or Is there another better way?</p>

<p>Thanks in advance</p>
