Exemplo n.º 1
0
        /// <summary>
        /// Updates a data object in the data store.
        /// </summary>
        /// <param name="parser">The input template parser.</param>
        /// <param name="dataObject">The data object to be updated.</param>
        public override void Update(WitsmlQueryParser parser, Log dataObject)
        {
            // Update ChannelSets + data via the ChannelSet data adapter
            foreach (var childParser in parser.ForkProperties("ChannelSet", ObjectTypes.ChannelSet))
            {
                var channelSet = WitsmlParser.Parse <ChannelSet>(childParser.Root);
                ChannelSetDataAdapter.Update(childParser, channelSet);
            }

            var uri = GetUri(dataObject);

            UpdateEntity(parser, uri);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates a data object in the data store.
        /// </summary>
        /// <param name="parser">The input template parser.</param>
        /// <param name="dataObject">The data object to be updated.</param>
        public override void Update(WitsmlQueryParser parser, Log dataObject)
        {
            using (var transaction = GetTransaction())
            {
                transaction.SetContext(dataObject.GetUri());

                // Update ChannelSets + data via the ChannelSet data adapter
                foreach (var childParser in parser.ForkProperties("ChannelSet", ObjectTypes.ChannelSet))
                {
                    var channelSet = WitsmlParser.Parse <ChannelSet>(childParser.Root);
                    ChannelSetDataAdapter.Update(childParser, channelSet);
                }

                var uri = GetUri(dataObject);
                UpdateEntity(parser, uri);

                // Commit transaction
                transaction.Commit();
            }
        }