Я пытаюсь выяснить, возможно ли вставить список объектов в таблицу, используя Dapper, но также применяя какую-то проверку, чтобы увидеть, какие данные должны быть включены.
var data = new List<TestInsertDataDto>
{
new TestInsertDataDto { InsertId = 1, Value = 2 },
new TestInsertDataDto { InsertId = 2, Value = 3 },
new TestInsertDataDto { InsertId = 3, Value = 6 }
};
await connection.ExecuteAsync(@"
INSERT INTO test_data (insertid, value)
VALUES (@InsertId, @Value)
-- I'd like to do a row per row check here to determine if the row should be
-- inserted or if this row for some reason shouldn't be inserted. This check
-- requires a query on the test_data table and a join on another table.", data)
;