Проблема с пользовательским фильтром exim

Вам нужно реализовать IEquatable или переопределить Equals() и GetHashCode()

Например:

public class CartProduct : IEquatable<CartProduct>
{
    public Int32 ID;
    public String Name;
    public Int32 Number;
    public Decimal CurrentPrice;

    public CartProduct(Int32 ID, String Name, Int32 Number, Decimal CurrentPrice)
    {
        this.ID = ID;
        this.Name = Name;
        this.Number = Number;
        this.CurrentPrice = CurrentPrice;
    }

    public String ToString()
    {
        return Name;
    }

    public bool Equals( CartProduct other )
    {
        // Would still want to check for null etc. first.
        return this.ID == other.ID && 
               this.Name == other.Name && 
               this.Number == other.Number && 
               this.CurrentPrice == other.CurrentPrice;
    }
}
0
задан Rob Dillstorm 15 January 2019 в 18:45
поделиться

1 ответ

Для сопоставления регулярных выражений попробуйте использовать matches вместо contains

$header_subject: matches "^([0-9]+)\@domain\.com"

.
0
ответ дан Rastalamm 15 January 2019 в 18:45
поделиться
Другие вопросы по тегам:

Похожие вопросы: