Skip to content

Commit

Permalink
Merge pull request #656 from mikependon/repodb-fixes
Browse files Browse the repository at this point in the history
Fixes to missing mapping within the BulkMerge for unspecified column mappings.
  • Loading branch information
mikependon authored Dec 1, 2020
2 parents 107ae38 + 0f56717 commit 505302f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 32 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ public static partial class SqlConnectionExtension
entityFields.Any(f => string.Equals(f.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Filter the fields (based on the mappings)
// Filter the fields (based on the mappings and qualifiers)
if (mappings?.Any() == true)
{
fields = fields
.Where(e =>
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true ||
qualifiers.Any(q => string.Equals(q.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Throw an error if there are no fields
Expand Down Expand Up @@ -353,12 +354,13 @@ public static partial class SqlConnectionExtension
readerFields.Any(fieldName => string.Equals(fieldName, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Filter the fields (based on the mappings)
// Filter the fields (based on the mappings and qualifiers)
if (mappings?.Any() == true)
{
fields = fields
.Where(e =>
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true ||
qualifiers.Any(q => string.Equals(q.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Throw an error if there are no fields
Expand Down Expand Up @@ -568,12 +570,13 @@ public static partial class SqlConnectionExtension
tableFields.Any(fieldName => string.Equals(fieldName, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Filter the fields (based on the mappings)
// Filter the fields (based on the mappings and qualifiers)
if (mappings?.Any() == true)
{
fields = fields
.Where(e =>
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true ||
qualifiers.Any(q => string.Equals(q.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Throw an error if there are no fields
Expand Down Expand Up @@ -810,12 +813,13 @@ public static partial class SqlConnectionExtension
entityFields.Any(f => string.Equals(f.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Filter the fields (based on the mappings)
// Filter the fields (based on the mappings and qualifiers)
if (mappings?.Any() == true)
{
fields = fields
.Where(e =>
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true ||
qualifiers.Any(q => string.Equals(q.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Throw an error if there are no fields
Expand Down Expand Up @@ -1040,12 +1044,13 @@ public static partial class SqlConnectionExtension
readerFields.Any(fieldName => string.Equals(fieldName, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Filter the fields (based on the mappings)
// Filter the fields (based on the mappings and qualifiers)
if (mappings?.Any() == true)
{
fields = fields
.Where(e =>
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true ||
qualifiers.Any(q => string.Equals(q.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Throw an error if there are no fields
Expand Down Expand Up @@ -1258,12 +1263,13 @@ public static partial class SqlConnectionExtension
tableFields.Any(fieldName => string.Equals(fieldName, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Filter the fields (based on the mappings)
// Filter the fields (based on the mappings and qualifiers)
if (mappings?.Any() == true)
{
fields = fields
.Where(e =>
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
mappings.Any(m => string.Equals(m.SourceColumn, e.Name, StringComparison.OrdinalIgnoreCase)) == true ||
qualifiers.Any(q => string.Equals(q.Name, e.Name, StringComparison.OrdinalIgnoreCase)) == true);
}

// Throw an error if there are no fields
Expand Down

0 comments on commit 505302f

Please sign in to comment.