示例#1
0
        private void GetDataset(Type type, object value, List <MssqlCommandBulkCopyDataSet> datasets)
        {
            var bulkDs = GetBulkCopyDataset(type, value);

            if (bulkDs != null)
            {
                datasets.Add(bulkDs);
                return;
            }
            var ds = new DataSet {
                EnforceConstraints = false
            };
            var reader = new EntityReader(value, type);

            ds.Load(reader, LoadOption.PreserveChanges, reader.GetTableNames());
            datasets.Add(new MssqlCommandBulkCopyDataSet(reader.Sizer, ds));
        }