Ejemplo n.º 1
0
        public async Task <IActionResult> Update(int eventId,
                                                 [FromBody] EventDataDto eventDataDto)
        {
            var data =
                await _eventDataService.UpdateAndReturnDataById(eventId, eventDataDto);

            return(Ok(data));
        }
Ejemplo n.º 2
0
        public async Task <EventDto> UpdateAndReturnDataById(int eventId,
                                                             EventDataDto eventDataDto)
        {
            _repository.Event.UpdateById(eventId, eventDataDto);
            await _repository.SaveAsync();

            var eventData = await _repository.Event.GetById(eventId, EventDto.Selector);

            return(eventData);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 基本驱动事件 示例
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public Task <JsonResult> DoEventAsync([FromBody] CacheParam param)
        {
            //通过事件驱动的实体对象确定所调用的事件驱动
            EventDataDto dto = new EventDataDto {
                EventDataName = "1:创建对象" + "  2:输入值=" + param.KeyName
            };

            //触发事件
            _eventBus.TriggerAsync(this, dto);
            return(Task.FromResult(Json(dto.EventDataName)));
        }