'Blazor Hidden input bind to Identity User

As Title states, I would like to bind IdentityUser Properties to a hidden form input. Or perhaps I am going about the wrong way. It is tracking who creates a new project. I have access to Identity and properties.

Here is an example of my form taking in an input. Project Target End Date: <input type="datetime-local" @bind="projectObject.TargetEndDate">

This is an example of what id like to have happen

    <input type="hidden" @bind="projectObject.CreatedBy"> 

(Take in IdentityUser some how here)

Here is my property binding. Project projectObject = new Project();

string CurrentUser { get; set; }

protected async override Task OnInitializedAsync()
{
    var authstate = await GetAuthenticationStateAsync.GetAuthenticationStateAsync();
    CurrentUser = authstate.User.Identity.Name;        
}

I would like to bind CurrentUser to CreatedBy. Coding answer would appreciated, however I would like to read about the answer as well.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source