public async Task <IActionResult> CreateEventAsync([FromBody] Engaze.Core.DataContract.Event @event) { if (@event == null) { return(BadRequest()); } var eventId = Guid.NewGuid(); await CommandDispatcher.Dispatch <Evento>(new CreateEvento(eventId, @event)); return(new ObjectResult(new { id = eventId }) { StatusCode = StatusCodes.Status201Created }); }
public CreateEvento(Guid eventId, Engaze.Core.DataContract.Event eventoContract) : base(eventId) { this.EventoContract = eventoContract; }
public static Evento ToDomainEvent(this Engaze.Core.DataContract.Event evnt) => JsonConvert.DeserializeObject <Evento>(JsonConvert.SerializeObject(evnt));
public UpdateEvento(Engaze.Core.DataContract.Event eventoContract) : base(eventoContract.EventId) { this.EventoContract = eventoContract; }
public async Task <IActionResult> UpdateEventAsync([FromBody] Engaze.Core.DataContract.Event @event) { await CommandDispatcher.Dispatch <Evento>(new UpdateEvento(@event)); return(new OkResult()); }