Elmah.PgsqlErrorLog.GetErrors C# (CSharp) Méthode

GetErrors() public méthode

public GetErrors ( int pageIndex, int pageSize, ICollection errorEntryList ) : int
pageIndex int
pageSize int
errorEntryList ICollection
Résultat int
        public override int GetErrors(int pageIndex, int pageSize, ICollection<ErrorLogEntry> errorEntryList)
        {
            if (pageIndex < 0) throw new ArgumentOutOfRangeException("pageIndex", pageIndex, null);
            if (pageSize < 0) throw new ArgumentOutOfRangeException("pageSize", pageSize, null);

            using (var connection = new NpgsqlConnection(ConnectionString))
            {
                connection.Open();

                using (var command = Commands.GetErrorsXml(this.ApplicationName, pageIndex, pageSize))
                {
                    command.Connection = connection;    
                    
                    using (var reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var id = reader.GetString(0);
                            var xml = reader.GetString(1);
                            var error = ErrorXml.DecodeString(xml);
                            errorEntryList.Add(new ErrorLogEntry(this, id, error));
                        }
                    }
                }

                using (var command = Commands.GetErrorsXmlTotal(this.ApplicationName))
                {
                    command.Connection = connection;
                    return Convert.ToInt32(command.ExecuteScalar());
                }
            }
        }