/************************************************************************************
*
* Umbraco Data Layer
* MIT Licensed work
* ©2008 Ruben Verborgh
*
***********************************************************************************/
using System;
using System.Data;
using System.Collections;
namespace umbraco.DataLayer
{
///
/// Represents an object that reads record data from a result set.
///
public interface IRecordsReader : IEnumerable, IDisposable
{
#region Properties
///
/// Gets a value indicating whether this instance has records.
///
/// true if this instance has records; otherwise, false.
bool HasRecords { get; }
#endregion
#region Reading Methods
///
/// Advances to the next record.
///
///
/// true if there are more records; otherwise, false.
///
bool Read();
///
/// Closes the reader.
///
void Close();
#endregion
#region Field Getters
///
/// Determines whether a field with the specified field name exists in the record.
/// The field can still contain a null value.
///
/// Name of the field.
/// true if the specified field exists; otherwise, false.
bool ContainsField(string fieldName);
///
/// Determines whether the specified field is null.
///
/// Name of the field.
/// true if the specified field is null; otherwise, false.
bool IsNull(string fieldName);
///
/// Gets the specified field value.
///
/// The field type.
/// Name of the field.
///
FieldType Get(string fieldName);
///
/// Gets the value of the specified field.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
object GetObject(string fieldName);
///
/// Gets the value of the specified field as a bool.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
bool GetBoolean(string fieldName);
///
/// Gets the value of the specified field as a byte.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
byte GetByte(string fieldName);
///
/// Gets the value of the specified field as a DateTime.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
DateTime GetDateTime(string fieldName);
///
/// Gets the value of the specified field as a decimal.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
decimal GetDecimal(string fieldName);
///
/// Gets the value of the specified field as a double.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
double GetDouble(string fieldName);
///
/// Gets the value of the specified field as a float.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
float GetFloat(string fieldName);
///
/// Gets the value of the specified field as a Guid.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
Guid GetGuid(string fieldName);
///
/// Gets the value of the specified field as a short.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
short GetShort(string fieldName);
///
/// Gets the value of the specified field as an int.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
int GetInt(string fieldName);
///
/// Gets the value of the specified field as a long.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
long GetLong(string fieldName);
///
/// Gets the value of the specified field as a string.
///
/// Name of the field.
/// The value of the field.
/// No column with the specified name was found.
string GetString(string fieldName);
#endregion
}
}