Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15.  
  16. namespace CRUD_TAREA
  17. {
  18. /// <summary>
  19. /// Lógica de interacción para MenuYLista.xaml
  20. /// </summary>
  21. public partial class MenuYLista : Page
  22. {
  23. public MenuYLista()
  24. {
  25. InitializeComponent();
  26. }
  27.  
  28. private void Refresh()
  29. {
  30. List<PersonViewModel> lst = new List<PersonViewModel>();
  31. using(Model.WPFCRUDTAREAEntities db=new Model.WPFCRUDTAREAEntities())
  32. {
  33. lst = (from d in db.person
  34. select new PersonViewModel
  35. {
  36. Name = d.Name,
  37. Age = d.Age,
  38. Id = d.Id
  39. }).ToList();
  40. }
  41. }
  42. }
  43.  
  44. public class PersonViewModel
  45. {
  46. public int Id { get; set; }
  47. public string Name { get; set; }
  48. public int Age { get; set; }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement