Skip to content
Snippets Groups Projects
Commit bdaceddd authored by esantangelo's avatar esantangelo
Browse files

data layer

parent c9c66397
No related branches found
No related tags found
1 merge request!37Feature/evaluation
......@@ -9,7 +9,6 @@ namespace Tsi1.DataLayer.Entities
public Activity()
{
Attendances = new HashSet<Attendance>();
Grades = new HashSet<Grade>();
}
public int Id { get; set; }
......@@ -27,7 +26,5 @@ namespace Tsi1.DataLayer.Entities
public Evaluation Evaluation { get; set; }
public ICollection<Attendance> Attendances { get; set; }
public ICollection<Grade> Grades { get; set; }
}
}
......@@ -17,6 +17,9 @@ namespace Tsi1.DataLayer.Entities
public bool IsCompleted { get; set; }
public Activity Activity { get; set; }
public EvaluationType EvaluationType { get; set; }
public ICollection<EvaluationInscription> EvaluationInscriptions { get; set; }
......
......@@ -10,7 +10,6 @@ namespace Tsi1.DataLayer.Entities
{
StudentCourses = new HashSet<StudentCourse>();
EvaluationInscriptions = new HashSet<EvaluationInscription>();
Grades = new HashSet<Grade>();
Submissions = new HashSet<Submission>();
}
......@@ -26,8 +25,6 @@ namespace Tsi1.DataLayer.Entities
public User User { get; set; }
public ICollection<StudentCourse> StudentCourses { get; set; }
public ICollection<Grade> Grades { get; set; }
public ICollection<EvaluationInscription> EvaluationInscriptions { get; set; }
public ICollection<Submission> Submissions { get; set; }
......
......@@ -20,6 +20,10 @@ namespace Tsi1.DataLayer.EntityConfiguration
builder.HasOne(x => x.Course)
.WithMany(x => x.Activities)
.HasForeignKey(x => x.CourseId);
builder.HasOne(x => x.Evaluation)
.WithOne(x => x.Activity)
.HasForeignKey<Activity>(x => x.EvaluationId);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment