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 = "" } }); } } }
public ActionResult <List <TodoItemPublic> > GetAll() { var ToDos = _context.Getall(); return(ToDos.Result); }