public override List <object> Query(
            string sqlQueryString,
            OrmAssemblySqlWindows ormCollectibleAssembly,
            string typeName,
            string propertyNameFilter,
            out OrmTypeWindows ormCollecibleType)
        {
            if (ormCollectibleAssembly == null)
            {
                throw new NullReferenceException(string.Format("ormCollectibleAssembly may not be null."));
            }
            if (ormCollectibleAssembly.AssemblyBuilderAccess != AssemblyBuilderAccess.RunAndCollect)
            {
                throw new ArgumentException(string.Format(
                                                "Querying the database with a raw SQL query string requires an {0} with the {1} property set to {2}.",
                                                typeof(OrmAssemblyWindows).FullName,
                                                EntityReaderGeneric <OrmAssemblyWindows> .GetPropertyName(p => p.AssemblyBuilderAccess, false),
                                                AssemblyBuilderAccess.RunAndCollect));
            }
            List <object> result = null;

            using (SQLiteConnection connection = new SQLiteConnection(_connectionString))
            {
                connection.Open();
                using (SQLiteCommand command = new SQLiteCommand(sqlQueryString, connection))
                {
                    command.CommandType = System.Data.CommandType.Text;
                    using (SQLiteDataReader reader = command.ExecuteReader())
                    {
                        ormCollecibleType = ormCollectibleAssembly.CreateOrmTypeFromSqlDataReader(typeName, reader, true);
                        result            = DataHelperWindows.ParseReaderToEntities(reader, ormCollecibleType.DotNetType, propertyNameFilter);
                    }
                }
            }
            return(result);
        }
Beispiel #2
0
 public abstract List <object> Query(
     string sqlQueryString,
     OrmAssemblySqlWindows ormCollectibleAssembly,
     string typeName,
     string propertyNameFilter,
     out OrmTypeWindows ormCollecibleType);