Example #1
0
        public Programme UpdateProgramme(Programme ProgrammeChanges)
        {
            var programmme = db.Programs.Attach(ProgrammeChanges);

            programmme.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            db.SaveChanges();
            return(ProgrammeChanges);
        }
Example #2
0
        public Programme DeleteProgramme(int id)
        {
            Programme programme = db.Programs.Find(id);

            if (programme != null)
            {
                db.Programs.Remove(programme);
                db.SaveChanges();
            }
            return(programme);
        }
Example #3
0
 public Programme AddProgramme(Programme Programme)
 {
     db.Programs.Add(Programme);
     db.SaveChanges();
     return(Programme);
 }