public async Task <bool> SalvarSala(SalaViewModel salaVM)
        {
            try
            {
                var sala           = Mapper.Map <Sala>(salaVM);
                var idsProfessores = salaVM.IdsProfessores;
                //Salvar Sala
                await BeginTransaction();

                if (sala.Id == 0)
                {
                    sala = await Task.Run(() => _salaRepository.AddReturn(sala));
                }
                else
                {
                    await Task.Run(() => _salaRepository.Update(sala));
                }
                await Commit();

                //Deletar SalaProfessorRelacional
                var salasProfessoresRalacionais = await _salaProfessorRelacionalRepository.Get(x => x.IdSala == sala.Id);

                foreach (var relacional in salasProfessoresRalacionais)
                {
                    await BeginTransaction();

                    await Task.Run(() => _salaProfessorRelacionalRepository.Delete(relacional));
                    await Commit();
                }
                //Inserir SalaProfessorRelacional
                foreach (int idProfessor in idsProfessores)
                {
                    SalaProfessorRelacional salaProfessor = new SalaProfessorRelacional
                    {
                        IdProfessor = idProfessor,
                        IdSala      = sala.Id
                    };
                    await BeginTransaction();

                    await Task.Run(() => _salaProfessorRelacionalRepository.Add(salaProfessor));
                    await Commit();
                }
                return(true);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
        public async Task <bool> DeletarProfessor(ProfessorViewModel professorVM)
        {
            try
            {
                var professor   = Mapper.Map <Professor>(professorVM);
                var relacionais = await _salaProfessorRelacionalRepository.Get(x => x.IdProfessor == professor.Id, new[] { "Sala" });

                if (await ValidarDeletarProfessor(professor, relacionais))
                {
                    await _usuarioApplicationService.ValidarExclusaoUsuario(professor.Telefone, "P");

                    foreach (var relacional in relacionais)
                    {
                        await BeginTransaction();

                        await Task.Run(() => _salaProfessorRelacionalRepository.Delete(relacional));
                        await Commit();
                    }

                    await BeginTransaction();

                    await Task.Run(() => _professorRepository.Delete(professor));
                    await Commit();

                    return(true);
                }
                return(false);
            }
            catch (Exception e)
            {
                throw e;
            }
        }