Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace CRUD_TAREA
- {
- /// <summary>
- /// Lógica de interacción para MenuYLista.xaml
- /// </summary>
- public partial class MenuYLista : Page
- {
- public MenuYLista()
- {
- InitializeComponent();
- }
- private void Refresh()
- {
- List<PersonViewModel> lst = new List<PersonViewModel>();
- using(Model.WPFCRUDTAREAEntities db=new Model.WPFCRUDTAREAEntities())
- {
- lst = (from d in db.person
- select new PersonViewModel
- {
- Name = d.Name,
- Age = d.Age,
- Id = d.Id
- }).ToList();
- }
- }
- }
- public class PersonViewModel
- {
- public int Id { get; set; }
- public string Name { get; set; }
- public int Age { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement