Example #1
0
        public ProgramCourse UpdateProgramCourse(ProgramCourse Program_CourseChanges)
        {
            var pc = db.programCourses.Attach(Program_CourseChanges);

            pc.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            db.SaveChanges();
            return(Program_CourseChanges);
        }
Example #2
0
        public ProgramCourse DeleteProgramCourse(int id)
        {
            ProgramCourse pc = db.programCourses.Find(id);

            if (pc != null)
            {
                db.programCourses.Remove(pc);
                db.SaveChanges();
            }
            return(pc);
        }
Example #3
0
 public ProgramCourse AddProgramCourse(ProgramCourse Program_Course)
 {
     db.programCourses.Add(Program_Course);
     db.SaveChanges();
     return(Program_Course);
 }