Remotely/Remotely_Server/Pages/Index.cshtml.cs
Jared Goodwin 8debc4bad5 Initial
2021-07-29 07:53:41 -07:00

35 lines
810 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Remotely_Server.Data;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Remotely_Server.Pages
{
public class IndexModel : PageModel
{
private DataService DB { get; }
public IndexModel(DataService db)
{
DB = db;
}
public string DefaultPrompt { get; set; }
public void OnGet()
{
if (User?.Identity?.IsAuthenticated == true)
{
DefaultPrompt = DB.GetDefaultPrompt(User.Identity.Name);
}
else
{
DefaultPrompt = DB.GetDefaultPrompt();
}
}
}
}