public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 {
     return(new Response()
     {
         Note = NoteApiModel.FromNote(await _context.Notes
                                      .Include(x => x.NoteTags)
                                      .Include("NoteTags.Tag")
                                      .Where(x => x.Slug == request.Slug)
                                      .SingleAsync())
     });
 }
示例#2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Note = NoteApiModel.FromNote(await _context.Notes.FindAsync(request.NoteId))
 };
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Notes = await _context.Notes.Select(x => NoteApiModel.FromNote(x, true)).ToListAsync()
 };