Ejemplo n.º 1
0
        public IActionResult Get(int semester)
        {
            if (semester == 0)
            {
                return(BadRequest());
            }
            else
            {
                var entityGrades = from b in context.StudentSubjects
                                   .Include(nameof(Models.Student))
                                   .Include(nameof(Models.Subject))
                                   where b.EnrollmentSemenster == semester
                                   select b;

                if (entityGrades.ToList().Count == 0)
                {
                    return(NotFound());
                }

                var subjectWithGrades = new List <Interfaces.SubjectWithGrade>();

                foreach (Models.StudentSubject s in entityGrades)
                {
                    var subject = new Interfaces.Subject(s.SubjectID, s.Subject.Name, s.Subject.Code, s.Subject.Credit, s.Subject.RecomendedSemester, s.Subject.ResponsibleProfessor);
                    var grade   = new Interfaces.Grade(s.StudentID, s.SubjectID, s.EnrollmentSemenster, s.Signature, s.Passed, s.Grade);

                    subjectWithGrades.Add(new Interfaces.SubjectWithGrade(subject, grade));
                }

                return(new ObjectResult(subjectWithGrades));
            }
        }
Ejemplo n.º 2
0
 public CurrentConditionsDisplay(Interfaces.Subject weatherData)
 {
     WeatherData = weatherData;
 }
Ejemplo n.º 3
0
 public static Subject ToDomainModel(this Interfaces.Subject @this)
 {
     return((Subject)@this);
 }