Example #1
0
        public async Task <IActionResult> Post([FromBody] Models.Tarefa tarefa) //aqui recebe uma parefa e vai posta no banco d dados
        {
            _context.Tarefas.Add(tarefa);
            await _context.SaveChangesAsync();

            return(Created("api/tarefasservice", tarefa));
        }
Example #2
0
 public static bool AtribuirTarefaEscopoValido(this Models.Tarefa tarefa)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotEmpty(tarefa.ResponsavelTecnico, "O Responsável técnico deve ser informado")
            ));
 }
Example #3
0
 public static bool EntregarTarefaEscopoValido(this Models.Tarefa tarefa)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotEmpty(tarefa.TempoGasto.ToString(), "Você não informou o tempo gasto na tarefa"),
                AssertionConcern.AssertIsNull(tarefa.Testes, "Foram feitos testes na tarefa?")
            ));
 }
Example #4
0
 public static bool AdicionarTarefaEscopoValido(this Models.Tarefa tarefa)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotEmpty(tarefa.Titulo, "O título da tarefa é obrigatório"),
                AssertionConcern.AssertNotEmpty(tarefa.Tipo, "O tipo da tarefa é obrigatório"),
                AssertionConcern.AssertNotEmpty(tarefa.Projeto, "O projeto da tarefa é obrigatório"),
                AssertionConcern.AssertNotEmpty(tarefa.Status, "O status da tarefa é obrigatório")
            ));
 }