I have 3 different tables and 3 different columns which are primary columns.
public class Student
{
public int StudentId { get; set; }
public string Name { get; set; }
}
public class Teacher
{
public int TeacherId { get; set; }
public string Name { get; set; }
}
public class Lesson
{
public int LessonId { get; set; }
public string Name { get; set; }
}
var _context = new MyContext()
_context.Student(x=>x.StudentId == someValue)
or
_context.Teacher(x=>x.TeacherId == someValue)
or
_context.Lesson(x=>x.TeacherId == someValue)
only changing table name and key value.
What is the best way using generic method?