| | 1 | | /* |
| | 2 | | * Copyright 2017 Stanislav Muhametsin. All rights Reserved. |
| | 3 | | * |
| | 4 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | 5 | | * you may not use this file except in compliance with the License. |
| | 6 | | * You may obtain a copy of the License at |
| | 7 | | * |
| | 8 | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | 9 | | * |
| | 10 | | * Unless required by applicable law or agreed to in writing, software |
| | 11 | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | 12 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| | 13 | | * implied. |
| | 14 | | * |
| | 15 | | * See the License for the specific language governing permissions and |
| | 16 | | * limitations under the License. |
| | 17 | | */ |
| | 18 | |
|
| | 19 | | using System; |
| | 20 | | using System.Collections.Generic; |
| | 21 | | using System.Text; |
| | 22 | | using UtilPack; |
| | 23 | | using UtilPack.TabularData; |
| | 24 | |
|
| | 25 | | namespace CBAM.SQL.Implementation |
| | 26 | | { |
| | 27 | | /// <summary> |
| | 28 | | /// This class provides default and simple implementation for <see cref="SQLDataRow"/>. |
| | 29 | | /// </summary> |
| | 30 | | public class SQLDataRowImpl : AsyncDataRowImpl, SQLDataRow |
| | 31 | | { |
| | 32 | | private readonly ReadOnlyResettableLazy<SQLException[]> _warnings; |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Creates a new instance of <see cref="SQLDataRowImpl"/> with given parameters. |
| | 36 | | /// </summary> |
| | 37 | | /// <param name="rowMetadata">The <see cref="DataRowMetaData{TColumnMetaData}"/>.</param> |
| | 38 | | /// <param name="columns">The columns array.</param> |
| | 39 | | /// <param name="warnings">The resettable lazy to get warnings as array of <see cref="SQLException"/>s.</param> |
| | 40 | | public SQLDataRowImpl( |
| | 41 | | DataRowMetaData<AsyncDataColumnMetaData> rowMetadata, |
| | 42 | | AsyncDataColumn[] columns, |
| | 43 | | ReadOnlyResettableLazy<SQLException[]> warnings |
| 93 | 44 | | ) : base( rowMetadata, columns ) |
| | 45 | | { |
| 93 | 46 | | this._warnings = ArgumentValidator.ValidateNotNull( nameof( warnings ), warnings ); |
| 93 | 47 | | } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// Implements <see cref="SQLStatementExecutionResult.Warnings"/> and gets current value of warnings as array of < |
| | 51 | | /// </summary> |
| | 52 | | /// <value>Warnings as array of <see cref="SQLException"/>s.</value> |
| 0 | 53 | | public SQLException[] Warnings => this._warnings.Value; |
| | 54 | |
|
| | 55 | |
|
| | 56 | | } |
| | 57 | | } |