public EditEventCommand(EventCreateOrEditDto request) { Id = request.Id; Title = request.Title; Description = request.Description; Category = request.Category; Date = request.Date; City = request.City; Venue = request.Venue; }
public EditEventCommandTest() { id = new Guid(); dbSetEvent = new Mock <DbSet <Event> >(); context = new Mock <IApplicationDbContext>(); stringLocalizer = new Mock <IStringLocalizer <EventsResource> >(); mapper = new Mock <IMapper>(); eventEntity = new Event { Id = id }; eventDto = new EventCreateOrEditDto { Id = id }; }
public async Task <ActionResult> Edit([FromBody] EventCreateOrEditDto editedEvent) { await Mediator.Send(new EditEventCommand(editedEvent)); return(NoContent()); }
public async Task <ActionResult <Guid> > Create([FromBody] EventCreateOrEditDto newEvent) { return(Ok(await Mediator.Send(new CreateEventCommand(newEvent)))); }