public async Task <PhotoDetailsResponse> Get(int id) { var photo = await _repo.Get(id); if (photo == null) { throw new RestException(HttpStatusCode.NotFound, new { Photo = "Not found" }); } return(_mapper.Map <PhotoDetailsResponse>(photo)); }