Exemple #1
0
        public List <Model.Person> Execute(DateTime date)
        {
            IEnumerable <Model.Person> book = new FindAllPersonsCommand().Execute();

            book = book.Where(p => p.Birthday.HasValue &&
                              p.Birthday.Value.DayOfYear > date.DayOfYear &&
                              p.Birthday.Value.DayOfYear < date.DayOfYear + MAX_DAYS);
            return(book.ToList());
        }
Exemple #2
0
        public List <Model.Person> Execute(string toSearch)
        {
            IEnumerable <Model.Person> book = new FindAllPersonsCommand().Execute();

            if (string.IsNullOrWhiteSpace(toSearch))
            {
                return(book.ToList());
            }

            book = book.Where(p => p.Name.Contains(toSearch) ||
                              (p.Note != null && p.Note.Contains(toSearch)) ||
                              p.Contacts.Any(c => c.Value.Contains(toSearch)));
            return(book.ToList());
        }