Exemple #1
0
        public AcademyProgram UpdateProgramme(AcademyProgram academyProgram)
        {
            var newAcadaProg = context.AcademyPrograms.Attach(academyProgram);

            newAcadaProg.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(academyProgram);
        }
Exemple #2
0
        public AcademyProgram DeleteProgramme(int id)
        {
            AcademyProgram academyProg = context.AcademyPrograms.Find(id);

            if (academyProg != null)
            {
                context.AcademyPrograms.Remove(academyProg);
                context.SaveChanges();
            }
            return(academyProg);
        }
Exemple #3
0
 public AcademyProgram AddProgramme(AcademyProgram academyProgram)
 {
     context.AcademyPrograms.Add(academyProgram);
     context.SaveChanges();
     return(academyProgram);
 }