Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using Microsoft.AspNetCore.Mvc.RazorPages;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UWofS.CS7;
  5. namespace NorthwindWeb.Pages
  6. {
  7. public class EmployeesModel : PageModel
  8. {
  9. public IEnumerable<string> EmployeeName { get; set; }
  10. public IEnumerable<string> Title { get; set; }
  11. public IEnumerable<string> Courtesy { get; set; }
  12. public IEnumerable<System.DateTime?> BirthDate { get; set; }
  13.  
  14. public void OnGet()
  15. {
  16. ViewData["Title"] = "Northwind Web Site - Employees";
  17.  
  18. EmployeeName = db.Employees.Select(s => s.FirstName + ' ' + s.LastName).ToArray();
  19. Title = db.Employees.Select(s => s.Title).ToArray();
  20. //Courtesy = db.Employees.Select(s => s.TitleOfCourtesy).ToArray();
  21. //BirthDate = db.Employees.Select(s => s.BirthDate).ToArray();
  22. }
  23.  
  24. private Northwind db;
  25.  
  26. public EmployeesModel(Northwind injectedContext)
  27. {
  28. db = injectedContext;
  29. }
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement