public int AddAppointment(Appointment appointment) { int resultToReturn; using (var context = new MVC_IF4101MVCLPACEntities()) { resultToReturn = context.InsertAppointment( appointment.CourseId, appointment.StudentId, appointment.ProfessorId, appointment.Motive, appointment.Accepted, appointment.DateTime.ToString()); } return(resultToReturn); }