public static void Create(LesSessionDeFormation ST) { try { using (BDDContext context = new BDDContext()) { context.SessionFormations.Add(ST); context.SaveChanges(); } } catch (Exception ex) { } }
public static void Update(LesSessionDeFormation St) { try { using (BDDContext context = new BDDContext()) { LesSessionDeFormation Sf = context.SessionFormations.FirstOrDefault(S => S.LesSessionDeFormationId == St.LesSessionDeFormationId); Sf.Description = St.Description; Sf.LesFormateurs = St.LesFormateurs; Sf.SessionCursus = St.SessionCursus; context.SaveChanges(); } } catch (Exception ex) { } }