Example #1
0
        public async Task <IActionResult> CreateTimeSlot()
        {
            var teacherId   = new Guid("4a8ca1a8-a832-4d69-9ff5-b3549dde0407");
            var calendarId  = new Guid("0fe38ffc-77df-4cda-823e-08d7d0af9fe2");
            var from        = new DateTime(2020, 3, 25, 20, 00, 00);
            var to          = new DateTime(2020, 3, 25, 22, 00, 00);
            var description = "Math tutoring";

            var timeslotCommand = new CreateTimeslotCommand(teacherId, calendarId, description, from, to);
            await _mediator.Send(timeslotCommand);

            return(Ok());
        }
Example #2
0
        public async Task <IActionResult> CreateTimeslot([FromBody] CreateTimeslotCommand request)
        {
            var response = await _teacherService.CreateTimeslot(request.TeacherId, request.CalendarId, request.StartTime, request.EndTime);

            return(Created("", new { Id = response }));
        }