Пример #1
0
        public TodoController(ILogger <TodoController> logger, TodoItemRepository todoItemRepository)
        {
            _logger             = logger;
            _todoItemRepository = todoItemRepository;

            if (_todoItemRepository.GetCount() == 0)
            {
                _todoItemRepository.Insert(new Domain.Entities.TodoItem {
                    Name = "测试1", IsComplete = false
                });
                _todoItemRepository.Insert(new Domain.Entities.TodoItem {
                    Name = "测试2", IsComplete = false
                });
            }
        }