vladikk / learning-ddd

MIT License
296 stars 38 forks source link

Syntax error in 06-13.cs? #1

Closed MitHub7 closed 2 years ago

MitHub7 commented 2 years ago

Hello,

It seems like there is a problem with the following code snippet : https://github.com/vladikk/learning-ddd/blob/main/listings/06-13.cs

public class Ticket
{
    // ...
    List<Message> _messages;
    // ...

    public void Execute(EvaluateAutomaticActions cmd)
    {
        if (this.IsEscalated && this.RemainingTimePercentage < 0.5 &&
            GetUnreadMessagesCount(for: AssignedAgent) > 0)
        {
            _agent = AssignNewAgent();
        }
    }

    public int GetUnreadMessagesCount(UserId id)
    {
        return _messages.Where(x => x.To == id && !x.WasRead).Count();
    }

    // ...
}

Why is there a for on line 10 ?

vladikk commented 2 years ago

Thanks so much for noticing this! I've just fixed it to a proper named argument name.