예제 #1
0
 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;
 }
예제 #2
0
        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
            };
        }
예제 #3
0
        public async Task <ActionResult> Edit([FromBody] EventCreateOrEditDto editedEvent)
        {
            await Mediator.Send(new EditEventCommand(editedEvent));

            return(NoContent());
        }
예제 #4
0
 public async Task <ActionResult <Guid> > Create([FromBody] EventCreateOrEditDto newEvent)
 {
     return(Ok(await Mediator.Send(new CreateEventCommand(newEvent))));
 }