Skip to content

Commit

Permalink
Minor comments and code organizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikependon committed Mar 16, 2023
1 parent b0f1b0b commit 4ee230b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
10 changes: 5 additions & 5 deletions RepoDb.Core/RepoDb/Extensions/DbCommandExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -844,21 +844,21 @@ private static void EnsureTableValueParameter(IDbDataParameter parameter)
DbFieldCollection dbFields)
{
if (dbFields is null || dbFields.IsEmpty()) return null;

var fieldNameSpan = fieldName.AsSpan();

if (fieldNameSpan.IsEmpty || fieldNameSpan.IsWhiteSpace())
{
return null;
}

var index = fieldNameSpan.IndexOf("_In_".AsSpan(), StringComparison.OrdinalIgnoreCase);

if (index >= 0)
{
fieldNameSpan = fieldNameSpan.Slice(0, index);
}

return dbFields.GetByName(fieldNameSpan.ToString());
}

Expand Down Expand Up @@ -887,7 +887,7 @@ private static void EnsureTableValueParameter(IDbDataParameter parameter)
}
else
{
return Convert.ChangeType(value, targetType);
return (value != DBNull.Value) ? Convert.ChangeType(value, targetType) : Activator.CreateInstance(targetType);
}
}

Expand Down
8 changes: 4 additions & 4 deletions RepoDb.Core/RepoDb/Operations/DbConnection/Merge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ public static partial class DbConnectionExtension
fields: GetQualifiedFields<TEntity>(fields, entity),
hints: hints,
commandTimeout: commandTimeout,
traceKey: traceKey,
traceKey: traceKey,
transaction: transaction,
trace: trace,
statementBuilder: statementBuilder);
Expand All @@ -735,7 +735,7 @@ public static partial class DbConnectionExtension
fields: GetQualifiedFields<TEntity>(fields, entity),
hints: hints,
commandTimeout: commandTimeout,
traceKey: traceKey,
traceKey: traceKey,
transaction: transaction,
trace: trace,
statementBuilder: statementBuilder);
Expand All @@ -752,7 +752,7 @@ public static partial class DbConnectionExtension
fields: GetQualifiedFields<TEntity>(fields, entity),
hints: hints,
commandTimeout: commandTimeout,
traceKey: traceKey,
traceKey: traceKey,
transaction: transaction,
trace: trace,
statementBuilder: statementBuilder);
Expand All @@ -766,7 +766,7 @@ public static partial class DbConnectionExtension
fields: GetQualifiedFields<TEntity>(fields, entity),
hints: hints,
commandTimeout: commandTimeout,
traceKey: traceKey,
traceKey: traceKey,
transaction: transaction,
trace: trace,
statementBuilder: statementBuilder);
Expand Down
11 changes: 0 additions & 11 deletions RepoDb.MySql/RepoDb.MySql.IntegrationTests/appveyor.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public MySqlStatementBuilder()
/// <param name="tableName">The name of the target table.</param>
/// <param name="fields">The mapping list of <see cref="Field"/> objects to be used.</param>
/// <param name="skip">The number of rows to skip.</param>
/// <param name="take">The number of rows per batch.</param>
/// <param name="take">The number of rows to take.</param>
/// <param name="orderBy">The list of fields for ordering.</param>
/// <param name="where">The query expression.</param>
/// <param name="hints">The table hints to be used.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ public MySqlConnectorStatementBuilder()
/// </summary>
/// <param name="tableName">The name of the target table.</param>
/// <param name="fields">The list of fields to be queried.</param>
/// <param name="page">The page of the batch.</param>
/// <param name="rowsPerBatch">The number of rows per batch.</param>
/// <param name="skip">The number of rows to skip.</param>
/// <param name="take">The number of rows to take.</param>
/// <param name="orderBy">The list of fields for ordering.</param>
/// <param name="where">The query expression.</param>
/// <param name="hints">The table hints to be used.</param>
Expand Down

0 comments on commit 4ee230b

Please sign in to comment.