How to reference a field other than the forign key field in the referenced table?

Vinod 1 Reputation point
2021-06-28T17:49:30.817+00:00

To simplify the issue I have two tables students and courses where student_id is the foreign key in the courses table. Now, in the courses controller, I want to access the student_name field to pass to the Index view. How can I achieve it? The present Index view lists all fields in courses table along with student_id.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,400 questions
{count} votes