Good morning classmates, I have related the table students and the teacher table in SQL SERVER 2014
I am now passing to ASP.NET MVC
the database with Entity Framework
. I have already generated the controllers and the views and I want that from my teacher view you can put a @Html.ActionLink
that takes me to a view where the student table is shown, but I do not know what data has to go in the controller to send that sight.
public class ProfesorController : Controller
{
private EscuelaBDEntities db = new EscuelaBDEntities();
// GET: Profesor
public ActionResult Index()
{
var Profesor = db.Profesor.Include(p => p.Estudiante).Include(p => p.Salones).Include(p => p.Instituto);
return View(Profesor.ToList());
}
@model IEnumerable<WebApplication1.Models.Profesor>
@{
ViewBag.Title = "Index";
}