/// <summary>
        /// 批量插入
        /// </summary>
        /// <typeparam name="T">泛型集合的类型</typeparam>
        /// <param name="list">要插入大泛型集合</param>
        public void BulkInsert <T>(IList <T> list)
        {
            if (list.Count == 0)
            {
                return;
            }
            using (var db = new EconomicalleagueContainer())
            {
                if (db.Database.Connection.State != ConnectionState.Open)
                {
                    db.Database.Connection.Open(); //打开Connection连接
                }
                using (var bulkCopy = new SqlBulkCopy((SqlConnection)db.Database.Connection))
                {
                    bulkCopy.BatchSize            = list.Count;
                    bulkCopy.DestinationTableName = typeof(T).Name;

                    var table = new DataTable();
                    var props = TypeDescriptor.GetProperties(typeof(T))

                                .Cast <PropertyDescriptor>()
                                .Where(propertyInfo => propertyInfo.PropertyType.Namespace.Equals("System"))
                                .ToArray();

                    foreach (var propertyInfo in props)
                    {
                        bulkCopy.ColumnMappings.Add(propertyInfo.Name, propertyInfo.Name);
                        table.Columns.Add(propertyInfo.Name, Nullable.GetUnderlyingType(propertyInfo.PropertyType) ?? propertyInfo.PropertyType);
                    }

                    var values = new object[props.Length];
                    foreach (var item in list)
                    {
                        for (var i = 0; i < values.Length; i++)
                        {
                            values[i] = props[i].GetValue(item);
                        }

                        table.Rows.Add(values);
                    }

                    bulkCopy.WriteToServer(table);
                }
                if (db.Database.Connection.State != ConnectionState.Closed)
                {
                    db.Database.Connection.Close(); //关闭Connection连接
                }
            }
        }
        /// <summary>
        /// 调用sql语句或存储过程返回多个结果集处理
        /// </summary>
        /// <param name="query"></param>
        /// <param name="parameters"></param>
        /// <param name="queryType"></param>
        /// <returns></returns>
        public MultipleResultSetWrapper MultipleResults(string query, IEnumerable <SqlParameter> parameters = null, CommandType queryType = CommandType.StoredProcedure)
        {
            EconomicalleagueContainer db = new EconomicalleagueContainer();

            return(new MultipleResultSetWrapper(db, query, queryType, parameters));
        }