Created
July 22, 2017 16:39
-
-
Save yostane/53078009976b014ffff6b3f12762fadf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.Mvc.RazorPages; | |
| using System; | |
| namespace RazorPages | |
| { | |
| /// <summary> | |
| /// This class is the code behind of the Contacts.cshtml page | |
| /// </summary> | |
| public class Contacts: PageModel | |
| { | |
| /// <summary> | |
| /// This property can be used in the page using @Model.Message | |
| /// </summary> | |
| public string Message { get; private set; } = "Contacts page: "; | |
| /// <summary> | |
| /// This property can be used in the page using @Model.Name | |
| /// </summary> | |
| public string Name { get; private set; } = "Yassine BENABBAS"; | |
| /// <summary> | |
| /// In this function, we can update properties before returning them to the page | |
| /// </summary> | |
| public void OnGet() | |
| { | |
| Message += $" { DateTime.Now }"; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment