Example #1
0
        public ActionResult <AppointmentGetSingleResponse> PostAppointment(AppointmentPostRequest appointment)
        {
            var savedAppointment =
                _dataRepository.PostAppointment(appointment);

            _appointmentHubContext.Clients.Group(
                $"Question-{appointment}")
            .SendAsync(
                "RecievedAppointment",
                _dataRepository.GetUnshownAppointments()
                );
            return(savedAppointment);
        }
        public AppointmentGetSingleResponse PostAppointment(AppointmentPostRequest appointment)
        {
            using (var connection = new SqlConnection(_connectionString))
            {
                connection.Open();
                var appointmentId = connection.QueryFirst <int>(
                    @"EXEC dbo.Appointment_Post
						@StudentId = @StudentId, @CourseId = @CourseId,
						@Description = @Description, @Start = @Start, 
						@Finish = @Finish"                        ,
                    appointment
                    );
                return(GetAppointment(appointmentId));
            }
        }