Show / Hide Table of Contents

Class JsonDataReader

Provides methods for reading data in the Json format.

Inheritance
System.Object
DataReader
JsonDataReader
ProcessJsonDataReader
Implements
System.IDisposable
Inherited Members
DataReader.HasValue()
DataReader.Dispose()
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 class JsonDataReader : DataReader, IDataReader, IDisposable

Constructors

JsonDataReader()

Declaration
protected JsonDataReader()

JsonDataReader(Stream)

Initializes a new instance of the JsonDataReader class using the specified stream.

Declaration
public JsonDataReader(Stream input)
Parameters
Type Name Description
System.IO.Stream input

The stream that contains data in Json format.

JsonDataReader(TextReader)

Initializes a new instance of the JsonDataReader class using the specified System.IO.TextReader.

Declaration
public JsonDataReader(TextReader input)
Parameters
Type Name Description
System.IO.TextReader input

System.IO.TextReader, from which the data in Json format should be read.

Properties

CurrentName

Declaration
public override string CurrentName { get; }
Property Value
Type Description
System.String
Overrides
DataReader.CurrentName

CurrentValue

Declaration
public override object CurrentValue { get; }
Property Value
Type Description
System.Object
Overrides
DataReader.CurrentValue

Methods

Close()

Closes the current JsonDataReader instance.

Declaration
public override void Close()
Overrides
DataReader.Close()

Dispose(Boolean)

Deletes, releases and resets managed and unmanaged resources.

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

true, if both managed and unmanaged resources must be released; false, if only unmanaged resources must be released.

Overrides
DataReader.Dispose(Boolean)

GetBoolValue()

Returns the value of the current property of the System.Boolean type.

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

The current value of the property of the System.Boolean type.

Overrides
DataReader.GetBoolValue()

GetDateTimeValue()

Returns the value of the current property of the System.DateTime type.

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

The current value of the property of the System.DateTime type.

Overrides
DataReader.GetDateTimeValue()

GetDeserializedObjectValue(Type)

Declaration
public override object GetDeserializedObjectValue(Type objectType)
Parameters
Type Name Description
System.Type objectType
Returns
Type Description
System.Object
Overrides
DataReader.GetDeserializedObjectValue(Type)

GetDoubleValue()

Returns the value of the current property of the System.Double type.

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

The current value of the property of the System.Double type.

Overrides
DataReader.GetDoubleValue()

GetEnumValue<TValue>()

Gets the enumeration element that corresponds to the value of the current property.

Declaration
public override TValue GetEnumValue<TValue>()

    where TValue : struct
Returns
Type Description
TValue

The enumeration element that corresponds to the value of the current property.

Type Parameters
Name Description
TValue

Any type.

Overrides
DataReader.GetEnumValue<TValue>()

GetGuidValue()

Returns the value of the current property of the System.Guid type.

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

The current value of the property of the System.Guid type.

Overrides
DataReader.GetGuidValue()

GetIntValue()

Returns the value of the current property of the System.Int32 type.

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

The current value of the property of the System.Int32 type.

Overrides
DataReader.GetIntValue()

GetLocalizableStringValue()

Returns the value of the current property of the LocalizableString type.

Declaration
public override LocalizableString GetLocalizableStringValue()
Returns
Type Description
LocalizableString

The current value of the property of the LocalizableString type.

Overrides
DataReader.GetLocalizableStringValue()

GetSerialazebleObjectValue(Type)

Gets the value of the current deserialized property converted to the specified type.

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

The type of the deserializable property value.

Returns
Type Description
System.Object

The value of the deserializable property of the objectType.

Overrides
DataReader.GetSerialazebleObjectValue(Type)

GetSerializableObjectValue()

Returns the value of the current deserialized property.

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

The value of the serializable property of the System.Object.

Overrides
DataReader.GetSerializableObjectValue()

GetSerializableObjectValue<TValue>()

Gets the value of the current deserialized property of this type.

Declaration
public override TValue GetSerializableObjectValue<TValue>()
Returns
Type Description
TValue

The value of the current deserializable property of the TValue type.

Type Parameters
Name Description
TValue

The type of the deserialized property value.

Overrides
DataReader.GetSerializableObjectValue<TValue>()

GetStreamValue()

Returns the value of the current property of the System.IO.Stream type.

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

The current value of the property of the System.IO.Stream type.

Overrides
DataReader.GetStreamValue()

GetStreamValue(Stream)

Writes the value of the current property to the specified stream.

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

The stream to write to.

Overrides
DataReader.GetStreamValue(Stream)

GetStringValue()

Returns the value of the current property of the System.String type.

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

The current value of the property of the System.String type.

Overrides
DataReader.GetStringValue()

GetValue(Type)

Gets the value of the current property converted to the specified type.

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

Type.

Returns
Type Description
System.Object

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

Overrides
DataReader.GetValue(Type)

GetValue(DataConverter)

Gets object that represents the value of the current property, converted with the help of the passed instance DataConverter.

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

The DataConverter instance, used for conversion.

Returns
Type Description
System.Object

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

Overrides
DataReader.GetValue(DataConverter)

GetValue<TValue>()

Gets the value of this type of the current property, converting it to this type.

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

The value of the property converted to the specified type.

Type Parameters
Name Description
TValue

Any type.

Overrides
DataReader.GetValue<TValue>()

Read()

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

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

The string with the current property name or empty string if the end of the data set has been reached.

Overrides
DataReader.Read()

ReadInto()

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

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

The string with the current property name or empty string if the current level has no attached properties.

Overrides
DataReader.ReadInto()

ReadNextCollectionItem()

Moves to the next element in the collection of elements.

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

true if the transition to the next element in collection has been successful; otherwise - false.

Overrides
DataReader.ReadNextCollectionItem()

ReadOut()

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

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

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

Overrides
DataReader.ReadOut()

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