public FacultyResponse DeleteFaculty(int fid) { FacultyResponse facultyDelete = context.Faculty.FirstOrDefault(p => p.fId == fid); if (facultyDelete != null) { context.Faculty.Remove(facultyDelete); context.SaveChanges(); } return(facultyDelete); }
public void SaveFaculty(FacultyResponse faculty) { if (faculty.fId == 0) { context.Faculty.Add(faculty); } else { FacultyResponse facultyEntry = context.Faculty .FirstOrDefault(p => p.fId == faculty.fId); if (facultyEntry != null) { facultyEntry.fName = faculty.fName; facultyEntry.fLastName = faculty.fLastName; } } context.SaveChanges(); }
public static void AddFResponse(FacultyResponse FacultyResponses) { fResponses.Add(FacultyResponses); }