Skip to content

Instantly share code, notes, and snippets.

@csharpfritz
Last active August 14, 2017 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csharpfritz/c6c4c8ffcc2ad443c5fea3231f1194ea to your computer and use it in GitHub Desktop.
Save csharpfritz/c6c4c8ffcc2ad443c5fea3231f1194ea to your computer and use it in GitHub Desktop.
RazorPage PageModel
namespace MyFirstRazorPage.Pages
{
public class NowModel : PageModel
{
private IFileProvider _FileProvider;
public NowModel(PhysicalFileProvider fileProvider)
{
_FileProvider = fileProvider;
LastModified = _FileProvider.GetFileInfo("Pages/Now.cshtml").LastModified.LocalDateTime;
}
public DateTime LastModified { get; set; }
public void OnGet() { }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment