#region Copyright
/*-----------------------------------------------------------------
 * File Name:          StaticExtend.cs
 *
 * Author:             John
 *
 * Create Date:        8/17/2015 9:28:07 PM
 *
 * Copyright:          --None
 * ----------------------------------------------------------------
 * Description:
 * 
 * ----------------------------------------------------------------
 * Revision History
 *      R1 -
 *         Editor:
 *         Date:
 *         Reason:
 *----------------------------------------------------------------*/
#endregion Copyright

using System.Data;
using Nickymaco.SQL.Collections;
using Nickymaco.SQL.Iterator;

namespace Nickymaco.SQL
{
    public static class StaticExtend
    {
        public static DynamicObjectCollection ToDynamicObjects(this IRecordsReader reader)
        {
            return new DynamicObjectCollection(new DynamicObjectRecordsReaderIterator(reader));
        }

        public static DynamicObjectCollection ToDynamicObjects(this DataTable table)
        {
            return new DynamicObjectCollection(new DynamicObjectDataTableIterator(table));
        }

        public static ArrayDataCollection ToArrayData(this IRecordsReader reader)
        {
            return new ArrayDataCollection(new ArrayRecordsReaderIterator(reader));
        }

        public static ArrayDataCollection ToArrayData(this DataTable table)
        {
            return new ArrayDataCollection(new ArrayDataTableIterator(table));
        }
    }
}