public PlaceToVisitResponse Put(UpdatePlaceToVisit request)
 {
     if (!PlacesToVisitRepository.PlaceExists(request.Id))
     {
         throw HttpError.NotFound("Place not found");
     }
     var place = PlacesToVisitRepository.UpdatePlace(request.ConvertTo<Place>());
     return new PlaceToVisitResponse
     {
         Place = place
     };
 }
        public PlaceToVisitResponse Put(UpdatePlaceToVisit request)
        {
            if (!PlacesToVisitRepository.PlaceExists(request.Id))
            {
                throw HttpError.NotFound("Place not found");
            }
            var place = PlacesToVisitRepository.UpdatePlace(request.ConvertTo <Place>());

            return(new PlaceToVisitResponse
            {
                Place = place
            });
        }
예제 #3
0
        public object Put(UpdatePlaceToVisit request)
        {
            if (!Db.Exists <Place>(x => x.Id == request.Id))
            {
                throw HttpError.NotFound("Place not found");
            }
            var place = request.ConvertTo <Place>();

            Db.Update(place);
            return(new PlaceToVisitResponse
            {
                Place = place
            });
        }