Passing code to page cshtml asp.net core razor

0

How do I pass this code that is on a .cs page to a cshtml page.

 ApplicationUser user = await UserManager.GetUserAsync(User);

This page is the layout, has no Model and no DTO.

Thank you

    
asked by anonymous 17.07.2018 / 20:59

1 answer

0

I did not quite understand the question, but you can try to use ViewData to send data from a .cs file to a .cshtml
Example .cs:

public IActionResult Index(){ ViewData["Codigo"] = user; }

Example .cshtml:

<h1> @ViewData["Codigo"] </h1>
    
16.08.2018 / 05:36