예제 #1
0
        public MarcRecord GetRecord
        (
            [NotNull] MarcRecord record
        )
        {
            Sure.NotNull(record, "record");

            string line = GetUtfString();

            if (string.IsNullOrEmpty(line))
            {
                return(null);
            }

            ProtocolText.ParseResponseForReadRecord
            (
                this,
                record
            );

            return(record);
        }
예제 #2
0
        /// <inheritdoc cref="AbstractCommand.Execute" />
        public override ServerResponse Execute
        (
            ClientQuery query
        )
        {
            ServerResponse result = base.Execute(query);

            // Check whether no records read
            if (result.GetReturnCode() != -201)
            {
                MarcRecord record = new MarcRecord
                {
                    HostName = Connection.Host,
                    Database = Database
                };

                record = ProtocolText.ParseResponseForReadRecord
                         (
                    result,
                    record
                         );
                record.Verify(ThrowOnVerify);

                if (ThrowOnEmptyRecord)
                {
                    IrbisNetworkUtility.ThrowIfEmptyRecord
                    (
                        record,
                        result
                    );
                }

                Record = record;
            }

            return(result);
        }