public Grades GradeByStudentAndCourseID(int sid, int cid)
        {
            Grades grade = ctx.Grades.Where(x => x.StudentID == sid && x.CourseID == cid).FirstOrDefault();

            return(grade);
        }
 public void RemoveGrade(Grades grade)
 {
     ctx.Grades.Attach(grade);
     ctx.Grades.Remove(grade);
     ctx.SaveChanges();
 }
 public void UpdateGrade(Grades grade)
 {
     ctx.Entry(grade).State = EntityState.Modified;
     ctx.SaveChanges();
 }
 public void InsertorUpdateGrade(Grades grade)
 {
     ctx.Grades.Add(grade);
     ctx.SaveChanges();
 }