コード例 #1
0
ファイル: TagApiModel.cs プロジェクト: geffzhang/Commitments
 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);
        }