Results 1 to 14 of 14

Thread: Conversion Question

Threaded View

  1. #14
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Conversion Question

    True I was using my own rather than using from an ASP.NET Core project using EF Core as shown below.

    Code:
    public class IndexModel : PageModel
    {
    
        public IDataProtector Protector;
        private readonly Context _context;
    
        public IndexModel(Context context, IDataProtectionProvider provider)
        {
            _context = context;
            Protector = provider.CreateProtector(nameof(UserLogin));
        }
    
        public List<SelectListItem> UserOptions { get; set; }
    
        public string EncryptedId { get; set; }
    
        public void OnGet()
        {
    
            ViewData["UserId"] = new SelectList(_context.UserLogin.AsNoTracking(), "Id", "EmailAddress");
    
        }
    }
    Last edited by kareninstructor; Mar 14th, 2024 at 03:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width