public bool Cadastrar(Tarefa tarefa) { if (String.IsNullOrEmpty(tarefa.Titulo)) { throw new ArgumentException("Parâmetro Titulo é obrigatório"); } if (String.IsNullOrEmpty(tarefa.Descricao)) { throw new ArgumentException("Parâmetro Descricao é obrigatório"); } if (String.IsNullOrEmpty(tarefa.Tipo)) { throw new ArgumentException("Parâmetro Titulo é obrigatório"); } var repository = new TarefaRepository(tarefa); return(repository.Cadastrar()); }