public ActionResult <Fact> Create([FromBody] FactDTO dto) { if (dto.Title == null || dto.Content == null) { return(ValidationProblem()); } var fact = new Fact(dto.Title, dto.Content); _repository.Add(fact); return(Ok(fact)); }
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); } } }