Пример #1
0
        public IEnumerable <Professor> FindByCellphoneNumber(string cellphoneNumber)
        {
            if (string.IsNullOrEmpty(cellphoneNumber))
            {
                throw new ArgumentNullException("cellphoneNumber");
            }

            return(_professorRepository.Find(p => p.CellphoneNumber.Contains(cellphoneNumber), o => o.OrderBy(p => p.CellphoneNumber)));
        }
Пример #2
0
        public override async Task Add(Professor entity)
        {
            if (_professorRepository.Find(p => p.Email == entity.Email).Result.Any())
            {
                Notificar("Já existe um professor cadastrado com o e-mail informado.");
            }

            if (_professorRepository.Find(p => p.Documento == entity.Documento).Result.Any())
            {
                Notificar("Já existe um professor cadastrado com o documento informado.");
            }

            if (PossuiNotificacao())
            {
                return;
            }

            await base.Add(entity);
        }