0
Help, guys!
I’ve tried to do everything, already includes "using System.Linq"and nothing. Anyone knows? Medicoscontroller
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CadeMeuMedico.Models;
using System.Data.Entity;
namespace CadeMeuMedico.Controllers
{
public class MedicosController : Controller
{
private CadeMeuMedicoBDEntities db = new CadeMeuMedicoBDEntities();
//
// GET: /Medicos/
public ActionResult Index()
{
var medicos = db.Medicos.Include(m => m.Cidades).Include(m => m.Especialidades).ToList();
return View(medicos);
}
}
}
Cademeumedico.Models
namespace CadeMeuMedico.Models
{
using System;
using System.Collections.Generic;
public partial class Medicos
{
public long IDMedico { get; set; }
public string CRM { get; set; }
public string Nome { get; set; }
public string Endereco { get; set; }
public string Bairro { get; set; }
public string Email { get; set; }
public bool AtendePorConvenio { get; set; }
public bool TemClinica { get; set; }
public string WebSiteBlog { get; set; }
public int IDCidade { get; set; }
public int IDEspecialidade { get; set; }
public virtual Cidades Cidades { get; set; }
public virtual Especialidades Especialidades { get; set; }
}
}
Avoid using images when you can include your code and error description
– Leandro Angelo
put the code of its class (Doctor)
– Geilton Xavier Santos de Jesus
Follow the code above.
– Joao Torres Moreira