Esempio n. 1
0
        internal protected DataTable GetCollection(Query query)
        {
            string sql;
            IReadOnlyDictionary <string, object> dbParameterValues;

            if (query.Top != 0 || query.Skip != 0)
            {
                sql = QueryGenerator.GeneratePagingStatement(query, out dbParameterValues);
            }
            else
            {
                sql = QueryGenerator.GenerateSelectStatement(query, out dbParameterValues);
            }
            DbParameter[] dbParameters = CreateParameters(dbParameterValues);
            DataTable     table        = ExecuteDataTable(sql, dbParameters);

            table.TableName = query.Schema.GetEntitySchema(query.Entity).Attribute(SchemaVocab.Collection).Value;
            //RecoverColumnNamesCaseSensitivity(table, query.Select.Properties);
            return(table);
        }