Show / Hide Table of Contents

Class DataReader

The base class for the classes that implement sequential reading of the data.

Inheritance
System.Object
DataReader
JsonDataReader
XmlDataReader
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
public abstract class DataReader : IDataReader, IDisposable

Constructors

DataReader()

Declaration
protected DataReader()

Properties

CurrentName

Gets the name of the property that are located at the current dataset position.

Declaration
public abstract string CurrentName { get; }
Property Value
Type Description
System.String

The name of the property that are located at the current dataset position.

CurrentValue

Gets the current value of the property that are located at the current dataset position.

Declaration
public abstract object CurrentValue { get; }
Property Value
Type Description
System.Object

Methods

Close()

Closes the current DataReader instance.

Declaration
public abstract void Close()

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected abstract void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

GetBoolValue()

Gets the System.Boolean instance that corresponds to the property/attribute value located at the current dataset position.

Declaration
public abstract bool GetBoolValue()
Returns
Type Description
System.Boolean

The current value of the property/attribute of the System.Boolean.

GetDateTimeValue()

Gets the System.DateTime instance that corresponds to the property/attribute value located at the current dataset position.

Declaration
public abstract DateTime GetDateTimeValue()
Returns
Type Description
System.DateTime

The current value of the property/attribute of the System.DateTime.

GetDeserializedObjectValue(Type)

Returns the deserialized value from all data set, cast to the specified type.

Declaration
public abstract object GetDeserializedObjectValue(Type objectType)
Parameters
Type Name Description
System.Type objectType

Object type for deserializing.

Returns
Type Description
System.Object

Deserialized object value.

GetDoubleValue()

Gets the System.Double instance that corresponds to the property/attribute value located at the current dataset position.

Declaration
public abstract double GetDoubleValue()
Returns
Type Description
System.Double

The current value of the property/attribute of the System.Double.

GetEnumValue<TValue>()

Gets the enumeration member that corresponds to the property/attribute value located at the current dataset position.

Declaration
public abstract TValue GetEnumValue<TValue>()

    where TValue : struct
Returns
Type Description
TValue

Enumeration member that corresponds to the current property/attribute value

Type Parameters
Name Description
TValue

The value of enumeration of any type.

GetGuidValue()

Gets the System.Guid instance that corresponds to the property/attribute value located at the current dataset position.

Declaration
public abstract Guid GetGuidValue()
Returns
Type Description
System.Guid

The current value of the property/attribute of the System.Guid.

GetIntValue()

Gets the System.Int32 instance that corresponds to the property/attribute value,

Declaration
public abstract int GetIntValue()
Returns
Type Description
System.Int32

The current value of the property/attribute of the System.Int32.

GetLocalizableStringValue()

Gets the LocalizableString instance that corresponds to the property/attribute value located at the current dataset position.

Declaration
public abstract LocalizableString GetLocalizableStringValue()
Returns
Type Description
LocalizableString

The current value of the property/attribute of the LocalizableString.

GetSerialazebleObjectValue(Type)

Returns the value of the serializable property/attribute at the current position of the data set, cast to the specified type.

Declaration
public abstract object GetSerialazebleObjectValue(Type objectType)
Parameters
Type Name Description
System.Type objectType

The value type of the serializable property/attribute.

Returns
Type Description
System.Object

The value of the serializable property/attribute of the type objectType.

Remarks

he type of serializable property/attribute must implement the interface System.Runtime.Serialization.ISerializable or be marked with the [Serializable] attribute.

GetSerializableObjectValue()

Declaration
public abstract object GetSerializableObjectValue()
Returns
Type Description
System.Object

GetSerializableObjectValue<TValue>()

Declaration
public abstract TValue GetSerializableObjectValue<TValue>()
Returns
Type Description
TValue
Type Parameters
Name Description
TValue

GetStreamValue()

Gets a new System.IO.Stream instance that corresponds to the property/attribute value located at the current dataset position.

Declaration
public abstract Stream GetStreamValue()
Returns
Type Description
System.IO.Stream

The current value of the property/attribute of the System.IO.Stream.

GetStreamValue(Stream)

Writes the contents of the current DataReader instance to the current stream.

Declaration
public abstract void GetStreamValue(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

The stream to write to.

GetStringValue()

Gets the string presentation of the property/attribute value that are located at the current dataset position.

Declaration
public abstract string GetStringValue()
Returns
Type Description
System.String

The current value of the property/attribute of the System.String.

GetValue(Type)

Gets the value of the property/attribute in the current dataset position, converted according to the specified conversion type.

Declaration
public abstract object GetValue(Type valueType)
Parameters
Type Name Description
System.Type valueType

Type.

Returns
Type Description
System.Object

The current value of the property/attribute, converted according to the valueType type.

GetValue(DataConverter)

Gets the object that represents the value of the property/attribute in the current dataset position, converted according to the specified conversion type.

Declaration
public abstract object GetValue(DataConverter converter)
Parameters
Type Name Description
DataConverter converter

The type of conversion.

Returns
Type Description
System.Object

The current value of the property/attribute of the System.Object type, converted according to the converter.

GetValue<TValue>()

Gets the value of a certain property/attribute type in the current dataset position, converting it to a certain type.

Declaration
public abstract TValue GetValue<TValue>()
Returns
Type Description
TValue

The converted property/attribute value.

Type Parameters
Name Description
TValue

The value of any type.

HasValue()

Declaration
public virtual bool HasValue()
Returns
Type Description
System.Boolean

Read()

Moves the current position in the data set to the next property/attribute of the current nesting level.

Declaration
public abstract string Read()
Returns
Type Description
System.String

The string with the property/attribute name in the dataset position after the method is complete or empty string if the end of the data set has been reached.

ReadInto()

Moves the current position in the data set to one nesting level down.

Declaration
public abstract string ReadInto()
Returns
Type Description
System.String

The string with the property/attribute name in the dataset position after the method is complete or empty string if there are no attached properties/attributes on the current level.

ReadNextCollectionItem()

Moves the current position in the collection ro the next element.

Declaration
public abstract bool ReadNextCollectionItem()
Returns
Type Description
System.Boolean

true if the current position in the collection has been moved to the next element; false if the last collection element has been reached.

ReadOut()

Moves the current position in the data set to one nesting level up.

Declaration
public abstract string ReadOut()
Returns
Type Description
System.String

The empty string. Call Read() to receive the name of the next property/attribute.

Implements

System.IDisposable

Extension Methods

BaseSerializableObjectUtilities.ReadSerializableObjectValue(DataReader)
ReflectionUtilities.GetPropertyValue(Object, String)
ReflectionUtilities.GetPropertyDefValue(Object, String, Object)
ReflectionUtilities.TryGetPropertyValue(Object, String, out Object)
ReflectionUtilities.HasProperty(Object, String)
ReflectionUtilities.GetPropertyValue(Object, String, BindingFlags)
ReflectionUtilities.GetPropertyValueByPath(Object, String)
ReflectionUtilities.SetPropertyValue(Object, String, Object)
ReflectionUtilities.TrySetPropertyValue(Object, String, Object)
ValidateUtilities.CheckArgumentNull(Object, String)
ValidateUtilities.CheckDependencyNull(Object, String)
ValidateUtilities.EnsureDependencyNotNull<T>(T, String)
MetaDataTestUtils.MetaPropertiesShouldNotHaveDefValue<TInstance>(TInstance)
MetaDataTestUtils.MetaPropertiesShouldNotHaveDefValue<TInstance>(TInstance, Boolean)
NSubstituteExtension.Protected(Object, String, Object[])
NSubstituteExtension.Protected(Object, String, Boolean, Object[])
NSubstituteExtension.ProtectedGeneric<T>(Object, String, Object[])
NSubstituteExtension.ProtectedGeneric<T>(Object, String, Boolean, Object[])
NSubstituteExtension.ProtectedProperty(Object, String)
NSubstituteExtension.MatchInstance<T>(T)
SubstituteUtilities.GetIsSubstituteObject(Object)
SubstituteUtilities.Instead<TInstance, TValue>(TInstance, Func<TInstance, TValue>)
Back to top Generated by DocFX