예제 #1
0
        public override async Task <FindReply> Find(FindRequest request, ServerCallContext context)
        {
            _logger.LogInformation($"Find invoked with Id {request.Id}");
            Photo ph = await photosService.FindAsync(request.Id);

            return(ph.ToFindReply());
        }
예제 #2
0
        public async Task <ActionResult <Photo> > Find(int id)
        {
            Photo ph = await service.FindAsync(id);

            if (ph == null)
            {
                return(NotFound());
            }
            return(ph);
        }
        public async Task <ActionResult <Photo> > Find(int id)
        {
            _logger.LogInformation($"Find invoked with Id {id}");
            Photo ph = await photosService.FindAsync(id);

            if (ph == null)
            {
                return(NotFound());
            }
            return(ph);
        }
예제 #4
0
        public async Task <ActionResult <Photo> > Find(int id)
        {
            Photo ph = await service.FindAsync(id);

            if (ph == null)
            {
                return(NotFound());
            }
            ph.ImageUrl = Url.Link(nameof(GetImage), new { id = ph.Id });
            return(ph);
        }