public IActionResult Create([FromBody] TimeslotDto timeslotDto) { timeslotDto.Id = Guid.NewGuid(); var timeslotEntity = _mapper.Map <Timeslot>(timeslotDto); _timeslotService.Create(timeslotEntity, timeslotDto.EventId); return(Ok(timeslotDto)); }
public IActionResult Update([FromBody] TimeslotDto timeslotDto) { if (timeslotDto == null || timeslotDto.Id == Guid.Empty) { return(BadRequest("Timeslot not found.")); } var timeslotEntity = _mapper.Map <Timeslot>(timeslotDto); _timeslotService.Update(timeslotEntity); return(Ok(timeslotDto)); }