public static IDbCommand GetDbCommand(IDataSourceDb database, string commandText = null, IDbConnection connection = null, IDbTransaction dbTransaction = null)
        {
            IDbCommand command = null;

            switch (database.DBTYPE)
            {
            case DataBaseType.SqlServer:
                command = new SqlCommand();
                break;

            case DataBaseType.MySql:
            case DataBaseType.Sqlite:
            case DataBaseType.Oracle:
                command = database.GetNewCommand(commandText, connection, dbTransaction);
                break;

                throw new ArgumentOutOfRangeException(nameof(database.DBTYPE), database.DBTYPE, null);

            case DataBaseType.Oledb:
#if NETFRAMEWORK
                command = new OleDbCommand();
                break;
#else
                throw new NotImplementedException($@".Net Standard haven't implemented this functionality yet.");
#endif

            case DataBaseType.Access95:
#if NETFRAMEWORK
                command = new OleDbCommand();
                break;
#else
                throw new NotImplementedException($@".Net Standard haven't implemented this functionality yet.");
#endif

            case DataBaseType.Odbc:
#if NETFRAMEWORK
                command = new OdbcCommand();
                break;
#else
                throw new NotImplementedException($@".Net Standard haven't implemented this functionality yet.");
#endif
            default:
                throw new ArgumentOutOfRangeException(nameof(database.DBTYPE), database.DBTYPE, null);
            }
            command.CommandText    = commandText;
            command.CommandTimeout = (int)database.Timeout.TotalSeconds;
            if (connection != null)
            {
                command.Connection = connection;
            }
            if (dbTransaction != null)
            {
                command.Transaction = dbTransaction;
            }
            return(command);
        }
        /// <summary>
        /// Executes the non query on list.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="tableName">Name of the table.</param>
        /// <param name="listPoco">The list poco.</param>
        /// <param name="buildSqlString">The build SQL string.</param>
        /// <returns>Numbers Of Rows Affected</returns>
        private static int ExecuteNonQueryOnListStandard <T>(IDataSourceDb database, string tableName, IEnumerable <T> listPoco, Action <StringBuilder, string, T, Expression <Func <T, object> > > buildSqlString, Expression <Func <T, object> > overrideKeys = null) where T : class
        {
            var records = 0;


            //     if (!EnableTransactionRollback && DBTYPE == DataBaseType.SqlServer) return BulkInsert(listPoco, tableName); TODO :: This triggers on any action type not insert only fix this

            using (var conn = database.GetNewConnection(false, true))
            {
                conn.Open();
                using (var trans = conn.BeginTransaction(IsolationLevel.ReadCommitted))
                {
                    var startTime = DateTime.Now;


                    foreach (var poco in listPoco)
                    {
                        try
                        {
                            var sqlBuilder = new StringBuilder();
                            buildSqlString(sqlBuilder, tableName, poco, overrideKeys);
                            var query = sqlBuilder.ToString();
                            using (var cmd = database.GetNewCommand(query, conn, trans))
                            {
                                var bucket = database.LogConnectionTime(conn, query);

                                var DbParameters = new ObjectToSqlHelper(database.DBTYPE).BuildDbParameterList(poco, database.GetNewParameter, database.XmlSerializer, database.JsonSerializer, database.CsvSerializer);
                                cmd.Parameters.AddRange(DbParameters.ToArray());
                                if (database.QueryBucketManager.IncludeReadableQuery)
                                {
                                    bucket.ReadableQuery = cmd.Parameters.ParamToSql(sqlBuilder.ToString());
                                }

                                records += cmd.ExecuteNonQuery();
                                bucket.ExecutedSuccesfully = true;
                            }
                        }
                        catch (Exception error)
                        {
                            if (database.EnableTransactionRollback)
                            {
                                trans.Rollback();
                                var endTime    = DateTime.Now;
                                var difference = endTime.Subtract(startTime);

                                return(records);
                            }
                            else
                            {
                                throw database.ErrorHandling(error);
                            }
                        }
                    }
                    if (records >= 0)
                    {
                        trans.Commit();
                        var endTime    = DateTime.Now;
                        var difference = endTime.Subtract(startTime);
                    }
                }
            }
            return(records);
        }