Beispiel #1
0
        protected override void AddCommandParmeters(MySqlCommand command, RecordEntity record, int index)
        {
            MxRecordInfo recordInfo = record.RecordInfo as MxRecordInfo;

            command.Parameters.AddWithValue($"a{index}", record.Id);
            command.Parameters.AddWithValue($"b{index}", record.Domain.Id);
            command.Parameters.AddWithValue($"c{index}", recordInfo?.Preference);
            command.Parameters.AddWithValue($"d{index}", recordInfo?.Host);
            command.Parameters.AddWithValue($"e{index}", record.EndDate);
            command.Parameters.AddWithValue($"f{index}", record.FailureCount);
            command.Parameters.AddWithValue($"g{index}", (ushort)record.ResponseCode);
        }
Beispiel #2
0
        private RecordEntity CreateRecordEntity(DbDataReader reader, int?recordId, DomainEntity domain)
        {
            int?   preference = reader.GetInt32Nullable("preference");
            string hostname   = reader.GetString("hostname");

            MxRecordInfo mxRecordInfo = preference == null || hostname == null
                ? MxRecordInfo.EmptyRecordInfo :
                                        new MxRecordInfo(hostname, preference.Value);

            return(new RecordEntity(
                       recordId.Value,
                       domain,
                       mxRecordInfo,
                       (RCode)reader.GetInt16("result_code"),
                       reader.GetInt16("failure_count")));
        }
 protected bool Equals(MxRecordInfo other)
 {
     return(string.Equals(Host, other.Host) && Preference == other.Preference);
 }