Пример #1
0
 internal SqlFileStream(string filename, SqlFileStreamMode mode, ManafestEntry entry) : this(filename, mode)
 {
     _entry = entry;
     if (mode == SqlFileStreamMode.Read)
     {
         var index = 0;
         _typeMappings = entry.Schema.ToDictionary(k => index++, v => v.LookupDataType());
         _objectBuffer = new object[entry.Schema.Count];
     }
 }
Пример #2
0
        public SqlFileStream CreateStream(string resultSetName)
        {
            if (_mode != SqlFileStreamMode.Write)
            {
                throw new Exception("File not open for write.");
            }
            var fileName = Path.Combine(_folder, resultSetName);
            var entry    = new ManafestEntry {
                FilePath = fileName, ResultSetName = resultSetName
            };
            var stream = new SqlFileStream(fileName, SqlFileStreamMode.Write, entry);

            _manafest.Add(entry);
            return(stream);
        }