public override void Do(EventModel model, ref List <MessageModel> replyMessages) { var message = model.message.text.Split(' '); var actionReply = ReflectionObject.GenericReflectionWithParm <Reply>($"{message[0].FirstCharToUpper()}Reply", new object[] { _context }); actionReply.Do(message, ref replyMessages); }
public async Task Post([FromBody] ReceiveMessageApiModel content) { List <MessageModel> replyMessages = new List <MessageModel>(); EventModel receiveEvent = content.events?.FirstOrDefault(); string replyToken = receiveEvent.replyToken; var lineEvent = ReflectionObject.GenericReflectionWithParm <LineEvent>($"{receiveEvent.type.FirstCharToUpper()}LineEvent", new object[] { _context }); if (lineEvent != null) { lineEvent.Do(receiveEvent, ref replyMessages); } await ResponseLine(replyToken, replyMessages); }