Example #1
0
        public void OnReadAll(IDataWriter <int> dataWriter)
        {
            var index = 0;

            var length = Content.Rows.Count;

            for (int i = 0; i < length; i++)
            {
                DataRowRW.Initialize(Content.Rows[i]);

                if (i != 0 && (Options & DataTableRWOptions.WriteToArrayFromBeginningSecondRows) != 0)
                {
                    dataWriter[index].WriteArray(DataRowRW);
                }
                else
                {
                    dataWriter[index].WriteObject(DataRowRW);
                }
            }
        }
Example #2
0
        public void WriteValue(IValueWriter valueWriter, T value)
        {
            if (value == null)
            {
                valueWriter.DirectWrite(null);

                return;
            }

            if (valueWriter is IValueWriter <T> tWriter)
            {
                tWriter.WriteValue(value);

                return;
            }

            var dataReader = new DataRowRW <T>();

            dataReader.Initialize(value);

            valueWriter.WriteObject(dataReader);
        }