CmisSync.Lib.Database.Database.ExecuteOneRecordSQL C# (CSharp) Метод

ExecuteOneRecordSQL() приватный Метод

Executes the SQL and Return one record results.
private ExecuteOneRecordSQL ( string text, object>.Dictionary parameters ) : object>.Dictionary
text string SQL
parameters object>.Dictionary Parameters.
Результат object>.Dictionary
        private Dictionary<string, object> ExecuteOneRecordSQL(string text, Dictionary<string, object> parameters)
        {
            using (var command = new SQLiteCommand(GetSQLiteConnection()))
            {
                try
                {
                    ComposeSQLCommand(command, text, parameters);
                    using (var dataReader = command.ExecuteReader())
                    {
                        var results = new Dictionary<string, object>();
                        if (dataReader.Read())
                        {
                            for (int i = 0; i < dataReader.FieldCount; i++)
                            {
                                results.Add(dataReader.GetName(i), dataReader[i]);
                            }
                        }
                        return results;
                    }
                }
                catch(SQLiteException e)
                {
                    Logger.Error(String.Format("Could not execute SQL: {0};", sqliteConnection), e);
                    throw;
                }
            }
        }