示例#1
0
        public void AddQuestion_Work()
        {
            Fact fact = new Fact("id", "test description");

            FactRepository factRepository = new FactRepository();

            factRepository.addFact(fact);
            Assert.True(factRepository.GetFacts().Count == 1);
            Assert.Contains <Fact>(fact, factRepository.GetFacts());
        }
        public override IEnumerable <Row> Execute(IEnumerable <Row> rows)
        {
            using (var conn = new NpgsqlConnection(conString))
            {
                conn.Open();
                Parallel.ForEach(rows, (row) =>
                {
                    FactRepository.Add(conn, row, _dictAirline, _dictAirport, _dictCity, _dictState, _dictTail);
                });

                foreach (var row in rows)
                {
                    yield return(row);
                }
            }
        }
示例#3
0
 public FactController(FactRepository repository)
 {
     _repository = repository;
 }