private List <DmarcConfigReadModelEntity> GetAllRecordEntities()
        {
            List <DmarcConfigReadModelEntity> entities = new List <DmarcConfigReadModelEntity>();

            using (DbDataReader reader = MySqlHelper.ExecuteReader(ConnectionString, "SELECT * FROM dns_record_dmarc_read_model;"))
            {
                while (reader.Read())
                {
                    DmarcConfigReadModelEntity dmarcConfigReadModelEntity =
                        new DmarcConfigReadModelEntity(
                            (int)reader.GetInt64("domain_id"),
                            reader.GetInt32("error_count"),
                            (ErrorType)Enum.Parse(typeof(ErrorType), reader.GetString("max_error_severity"), true),
                            reader.GetString("model"));

                    entities.Add(dmarcConfigReadModelEntity);
                }
            }
            return(entities);
        }
Esempio n. 2
0
 protected bool Equals(DmarcConfigReadModelEntity other)
 {
     return(DomainId == other.DomainId && ErrorCount == other.ErrorCount && MaxErrorSeverity == other.MaxErrorSeverity && string.Equals(ReadModel, other.ReadModel));
 }