// Copyright (C) Stichting Deltares 2016. All rights reserved. // // This file is part of Ringtoets. // // Ringtoets is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System; namespace Core.Common.IO.Readers { /// /// This interface can be used for data bases to implement a row/column based way of reading records. /// public interface IRowBasedDatabaseReader { /// /// Gets the path of the database being read. /// string Path { get; } /// /// Moves the reader to the next record in the database. /// void MoveNext(); /// /// Reads a value at column from the database. /// /// The expected type of value in the column with name . /// The name of the column to read from. /// The read value from the column with name . /// Thrown when the value in the column was not of type . T Read(string columnName); /// /// Reads the value in the column with name from the /// current row that's being pointed at. If the column has a value of , /// then the default value for is returned. /// /// The type of object to read. /// The name of the column to read from. /// The value in the column, or null if the value was . /// Thrown when the value in the column could not be casted to type . T ReadOrDefault(string columnName); } }