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 }); } }
public async Task <ActionResult <IEnumerable <DiaryNote> > > Create([FromBody] DiaryNote diaryNote) { await _repository.Create(diaryNote); return(Ok()); }