예제 #1
0
 public static TagApiModel FromTag(Tag tag)
 => new TagApiModel
 {
     TagId = tag.TagId,
     Name  = tag.Name,
     Slug  = tag.Slug,
     Notes = tag.NoteTags.Select(x => NoteApiModel.FromNote(x.Note, false)).ToList()
 };
예제 #2
0
        public async Task <SaveNoteCommand.Response> HandleSaveNoteCommand(SaveNoteCommand.Request request, CancellationToken cancellationToken, SaveNoteCommand.Response response)
        {
            var note = await _context.Notes.FindAsync(response.NoteId);

            await _hubContext.Clients.All.SendAsync("message", new
            {
                Type    = "[Note] Saved",
                Payload = new { note = NoteApiModel.FromNote(note) }
            });

            return(response);
        }