public async Task <EventDto> Post([FromBody] EventFormDto dto) { var eventInfo = new EventInfo(); dto.CopyTo(eventInfo); await _eventManagementService.CreateNewEventAsync(eventInfo); return(new EventDto(eventInfo)); }
public async Task <ActionResult <EventDto> > Put(int id, [FromBody] EventFormDto dto) { var eventInfo = await _eventInfoService.GetEventInfoByIdAsync(id); if (eventInfo.Archived) { return(NotFound()); } dto.CopyTo(eventInfo); await _eventManagementService.UpdateEventAsync(eventInfo); return(Ok(new EventDto(eventInfo))); }