Below is a simple approach to save relational database records which is working perfectly fine. I have doubt on one scenario. Before that i need to know the way i am approaching
Try to add 2 Students in your Review class, for example:
[Table("tb_review")]
public class Review
{
[Key]
public int id { get; set; }
public string message { get; set; }
public Student student{ get; set; } // review of which student
public Student reviewer{ get; set; } // whom send the review
}
And your Student class should be like this:
[Table("tb_student")]
public class Student
{
[Key]
public int id { get; set; }
public string name { get; set; }
[InverseProperty("student")]
public List reviewAbout{ get; set; }
[InverseProperty("reviewer")]
public List reviewBy{ get; set; }
}