Example #1
0
        public async Task <IComandoResultado> ManipuladorAsync(EditarFotoAlunoComando comando)
        {
            // Validar Comando
            comando.Valido();
            AddNotifications(comando.Notifications);

            //Criar a entidade
            var aluno = new AcademiaDanca.Dominio.Contexto.Entidade.Aluno(comando.Id, comando.Foto);

            AddNotifications(aluno.Notifications);
            if (Invalid)
            {
                return(new ComandoResultado(
                           false,
                           "Por favor, corrija os campos abaixo",
                           Notifications));
            }
            //Persistir os dados

            await _repositorio.EditarFotoAsync(aluno);

            // Retornar o resultado para tela
            return(new ComandoResultado(true, "Funcionario cadastrado com sucesso", new
            {
                Id = 0,
                Nome = "",
                Status = true
            }));
        }