public void Run()
        {
            var dataReader = new DataReaderMock(1000, SchemaTable);

            using (var memoryStream = new MemoryStream())
            {
                DataSerializer.Serialize(memoryStream, dataReader);
            }
        }
예제 #2
0
        static DeserializeBenchmark()
        {
            var schemaTable = new DataTable();

            schemaTable.Columns.Add("ColumnName", typeof(string));
            schemaTable.Columns.Add("DataType", typeof(Type));

            schemaTable.Rows.Add("foo", typeof(int));
            schemaTable.Rows.Add("bar", typeof(Guid));
            schemaTable.Rows.Add("baz", typeof(float));

            var dataReader = new DataReaderMock(1000, schemaTable);

            using (var memoryStream = new MemoryStream())
            {
                DataSerializer.Serialize(memoryStream, dataReader);

                SerializedDataReader = memoryStream.ToArray();
            }
        }