示例#1
0
        public TodoController(ITodo context)
        {
            _context = context;

            if (_context.Getall().Result.Count() < 5)
            {
                for (int i = 0; i < 5; ++i)
                {
                    _context.Create(new TodoItemPublic {
                        Name = "Item number" + i,
                        User = new User {
                            Id        = 4,
                            FirstName = "",
                            LastName  = "",
                            Fullname  = ""
                        }
                    });
                }
            }
        }
示例#2
0
        public ActionResult <List <TodoItemPublic> > GetAll()
        {
            var ToDos = _context.Getall();

            return(ToDos.Result);
        }