コード例 #1
0
        private void ReceivedEvent(object sender, BasicDeliverEventArgs e)
        {
            if (e.RoutingKey == EventBusConsts.DiaryNoteQueue)
            {
                var msg  = Encoding.UTF8.GetString(e.Body.Span);
                var data = JsonConvert.DeserializeObject <SaveDiaryNoteEvent>(msg);

                var result = _repository.Create(new DiaryNote()
                {
                    PersonName = data.PersonName, Note = data.Note
                });
            }
        }
コード例 #2
0
        public async Task <ActionResult <IEnumerable <DiaryNote> > > Create([FromBody] DiaryNote diaryNote)
        {
            await _repository.Create(diaryNote);

            return(Ok());
        }