quisiera saber si alguien me ayuda con el siguiente error, en visual studio 2013, estoy creando un simple crud del nombre y edad de una persona en WPF, al momento de referenciar los valores de la tabla 'person' en este caso 'Age', me sale el siguiente error: No se puede convertir implícitamente el tipo 'string' en 'int'. Todo eso ocurre en la linea del Age = d.Age, A que se deberá dicho problema?
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; }
}
}