Ejemplo n.º 1
0
        public OperationResult Put(Guid id, VenueResource venueResource)
        {
            var updateVenueCommand = new UpdateVenueCommand(
                id: id,
                venueName: venueResource.Name,
                address: venueResource.Address,
                mapURN: venueResource.MapURN,
                contact: venueResource.Contact,
                version: venueResource.Version);

            commandProcessor.Send(updateVenueCommand);

            var venue = new VenueTranslator().Translate(
                new VenueReader(_unitOfWorkFactory, false)
                    .Get(updateVenueCommand.Id)
                );
            
            return new OperationResult.OK
                    {
                        ResponseResource = venue
                    };
        }
Ejemplo n.º 2
0
        public OperationResult Put(Guid id, VenueResource venueResource)
        {
            var updateVenueCommand = new UpdateVenueCommand(
                id: id,
                venueName: venueResource.Name,
                address: venueResource.Address,
                mapURN: venueResource.MapURN,
                contact: venueResource.Contact,
                version: venueResource.Version);

            commandProcessor.Send(updateVenueCommand);

            var venue = new VenueTranslator().Translate(
                new VenueReader(_unitOfWorkFactory, false)
                .Get(updateVenueCommand.Id)
                );

            return(new OperationResult.OK
            {
                ResponseResource = venue
            });
        }