Skip to content

v3.12.4

Choose a tag to compare

@JonathanMagnan JonathanMagnan released this 08 Jun 15:17
· 891 commits to master since this release

Download the library here

ADDED: MergeMatchedAndOneNotConditionExpression options for SQL Server.

By example, when specifying one or many columns that at least one value must be different:

ctx.BulkMerge(list, operation => 
   operation.MergeMatchedAndOneNotConditionExpression = entity => 
      new {entity.ColumnFakeKey1, entity.ColumnFakeKey2});

The MATCHED part is modified to ADD the condition expression specified.

WHEN MATCHED   AND ( ( ( DestinationTable.[ColumnFakeKey1] IS NULL
                         AND StagingTable.[ColumnFakeKey1] IS NOT NULL
                       )
                       OR ( DestinationTable.[ColumnFakeKey1] IS NOT NULL
                            AND StagingTable.[ColumnFakeKey1] IS NULL
                          )
                       OR DestinationTable.[ColumnFakeKey1] <> StagingTable.[ColumnFakeKey1]
                     )
                     OR ( ( DestinationTable.[ColumnFakeKey2] IS NULL
                            AND StagingTable.[ColumnFakeKey2] IS NOT NULL
                          )
                          OR ( DestinationTable.[ColumnFakeKey2] IS NOT NULL
                               AND StagingTable.[ColumnFakeKey2] IS NULL
                             )
                          OR DestinationTable.[ColumnFakeKey2] <> StagingTable.[ColumnFakeKey2]
                        )
                   ) THEN

PRO Version unlocked for the current month (June)