I have the following:
public abstract class Person
{
public DateTime CreatedAt { get; set; }
public abstract bool IsMatch(Person person);
}
public class Employee : Person
{
public int Id { get; set; }
public string Role { get; set; }
public override bool IsMatch(Employee person)
{
return Id == person.Id;
}
}
The compiler doesn't like my override of the IsMatch method.
- Why is this? Empolyee is a Person so why is it complaining?
- What is the best way around this? Would I need to cast to Employee in the IsMatch override?
Thanks.