示例#1
0
        public async Task <AppointmentDto> AddSectionAsync(AppointmentAddSectionDto addSectionDto)
        {
            AddSection.Command command = _mapper.Map <AddSection.Command>(addSectionDto);
            await _mediator.Send(command);

            return(await GetByIdAsync(addSectionDto.Id));
        }
示例#2
0
        public void Should_Map()
        {
            // Arrange
            var dto = new AppointmentAddSectionDto
            {
                Id        = Guid.NewGuid(),
                SectionId = Guid.NewGuid()
            };

            // Act
            AddSection.Command command = _mapper.Map <AddSection.Command>(dto);

            // Assert
            command.Should().BeEquivalentTo(dto);
        }
示例#3
0
 public async Task <ActionResult <AppointmentDto> > AddSection([FromRoute] AppointmentAddSectionDto addSectionDto)
 {
     return(await _appointmentService.AddSectionAsync(addSectionDto));
 }