Код: Выделить всё
parameters = new List
() { new Parameter() { parameterName="value", parameterType="string"} }
Код: Выделить всё
public class Parameter
{
public string parameterName;
public string parameterType;
}
мой класс метода (я создал до объектов метода, в которых хранится список объектов параметров):
Код: Выделить всё
public class Method
{
public List
parameters { get; set;}
public string modifier { get; set; }
public string name { get; set; }
public string type { get; set; }
public override bool Equals(object obj)
{
return this.modifier == ((Method)obj).modifier && this.name == ((Method)obj).name && this.type == ((Method)obj).type
&& this.parameters == ((Method)obj).parameters;
}
}
Код: Выделить всё
public override bool Equals(object obj)
{
return this.modifier == ((Method)obj).modifier && this.name == ((Method)obj).name && this.type == ((Method)obj).type
&& this.parameters == ((Method)obj).parameters;
}
Как я могу сравнить два списка объектов-параметров в этом методе Equals(), нужно ли мне сравнивать элементы каждый (например, сравнивать parameterName и parameterType всех объектов в списке)?