I'm trying to implement a method:
public Referee GetRefereeById(int refereeId)
{
var result = from b in Referees
where b.PersonId.Equals(refereeId)
select b;
return (Referee)result;
}
This method is supposed to return a referee object. Any idea what I'm doing wrong?
Try
return result.FirstOrDefault();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With