Beispiel #1
0
        /// <Author>Nelson Martins</Author>
        /// <Date>21/02/19</Date>
        /// <summary>
        /// Construtor
        /// Cria um novo TarefaItem se a coleção estiver vazia,
        /// o que significa que você não pode excluir todos as TarefasItems.
        /// </summary>
        /// <param name="context"></param>
        public TarefaController(ITarefaDAL iTarefaDAL)
        {
            _iTarefaDAL = iTarefaDAL;

            if (_iTarefaDAL.ObterTarefas().Count() == 0)
            {
                //_context.TarefaItems.Add(new Tarefa { Nome = "Item1" });
                //_iTarefaDAL.Ins .Add(new Tarefa { Nome = "Item1" });
                //_context.SaveChanges();
            }
        }
Beispiel #2
0
 public IEnumerable <Tarefa> ObterTarefas()
 {
     //return await _context.TarefaItems.ToListAsync();
     return(_iTarefaDAL.ObterTarefas());
 }