igor-tkachev/bltoolkit — pull request #313 by maxim-boligatov (2014-05-28 22:17:42+00:00)
Title: Add constraints for bulk insertion, binaries folder with latest compiled version, fix if issue 310 (wrong byte[] representation for SQL server).

So one of questions solved in this request:
Why should we check constraints on bulk insertion!?
Obviously it is good idea... Bulk insertion is part of InsertBatch method.
As I understand it that method should make the same operation as normal Insert method but for multiple objects. So it is very bad idea to skip check of FK constraints during batch operation.

Of course somebody can tell that InsertBatch can be used for very heavy loading of data into table. But I cannot agree. Huge load can be handled directly by SqlBulkCopy as some exceptional need.
As option we can add parameter for Insert batch (..., bool constraints).

So I think that it should be changed to support constraints. Main purpose of InsertBatch is not huge loads without any validation. It is way to optimize insertion for 10-30 items (single sql command instead of multiple inserts).

P.S.
I also created UpdateBatch as extension method. So maybe later I will add it to complete API provided by BLToolkit for bulk operations... but not in this request.