Skip to content

Commit 7f2894a

Browse files
committed
Apply some mostly automatic fixes
1 parent c0f75be commit 7f2894a

52 files changed

Lines changed: 186 additions & 301 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-pr.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/RepoDb.Core.IntegrationTests/PropertyHandlerImplicitTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ private class EntityModelForClass
223223

224224
public short ColumnFloatNotNull { get; set; } = 0;
225225

226-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
226+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
227227

228-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
228+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
229229
}
230230

231231
private class ImmutableEntityModelForClass
@@ -249,9 +249,9 @@ public ImmutableEntityModelForClass(long id,
249249

250250
public short ColumnFloatNotNull { get; set; } = 0;
251251

252-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
252+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
253253

254-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
254+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
255255
}
256256

257257
private class EntityModelForIntToStringType
@@ -268,9 +268,9 @@ private class EntityModelForIntToStringType
268268

269269
public short ColumnFloatNotNull { get; set; } = 0;
270270

271-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
271+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
272272

273-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
273+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
274274
}
275275

276276
private class EntityModelForNumberPropertiesToLongType
@@ -289,9 +289,9 @@ private class EntityModelForNumberPropertiesToLongType
289289

290290
public short ColumnFloatNotNull { get; set; } = 0;
291291

292-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
292+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
293293

294-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
294+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
295295
}
296296

297297
private class EntityModelForDateTimeKind

src/RepoDb.Core.IntegrationTests/PropertyHandlerTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ private class EntityModelForClass
214214

215215
public short ColumnFloatNotNull { get; set; } = 0;
216216

217-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
217+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
218218

219-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
219+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
220220
}
221221

222222
[Map("[dbo].[PropertyHandler]")]
@@ -242,9 +242,9 @@ public ImmutableEntityModelForClass(long id,
242242

243243
public short ColumnFloatNotNull { get; set; } = 0;
244244

245-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
245+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
246246

247-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
247+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
248248
}
249249

250250
[Map("[dbo].[PropertyHandler]")]
@@ -264,9 +264,9 @@ private class EntityModelForIntToStringType
264264

265265
public short ColumnFloatNotNull { get; set; } = 0;
266266

267-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
267+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
268268

269-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
269+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
270270
}
271271

272272
[Map("[dbo].[PropertyHandler]")]
@@ -288,9 +288,9 @@ private class EntityModelForNumberPropertiesToLongType
288288

289289
public short ColumnFloatNotNull { get; set; } = 0;
290290

291-
public DateTime ColumnDateTimeNotNull { get; set; } = System.DateTime.UtcNow.Date;
291+
public DateTime ColumnDateTimeNotNull { get; set; } = DateTime.UtcNow.Date;
292292

293-
public DateTime ColumnDateTime2NotNull { get; set; } = System.DateTime.UtcNow;
293+
public DateTime ColumnDateTime2NotNull { get; set; } = DateTime.UtcNow;
294294
}
295295

296296
[Map("[dbo].[PropertyHandler]")]

src/RepoDb.MySqlConnector/StatementBuilders/MySqlConnectorStatementBuilder.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public override string CreateBatchQuery(string tableName,
8686
string? hints = null)
8787
{
8888
// Ensure with guards
89-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
89+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
9090

9191
// Validate the hints
9292
GuardHints(hints);
@@ -194,7 +194,7 @@ public override string CreateExists(string tableName,
194194
QueryGroup? where = null,
195195
string? hints = null)
196196
{
197-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
197+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
198198

199199
// Validate the hints
200200
GuardHints(hints);
@@ -300,7 +300,7 @@ public override string CreateInsertAll(string tableName,
300300
IEnumerable<DbField> keyFields,
301301
string? hints = null)
302302
{
303-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
303+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
304304
GuardHints(hints);
305305

306306
// Validate the multiple statement execution
@@ -471,7 +471,7 @@ public override string CreateMerge(string tableName,
471471
IEnumerable<DbField> keyFields,
472472
IEnumerable<Field> qualifiers, string? hints = null)
473473
{
474-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
474+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
475475
GuardHints(hints);
476476

477477
// Verify the fields
@@ -604,7 +604,7 @@ public override string CreateMergeAll(string tableName,
604604
int batchSize,
605605
IEnumerable<DbField> keyFields, string? hints = null)
606606
{
607-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
607+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
608608
GuardHints(hints);
609609

610610
// Verify the fields
@@ -801,7 +801,7 @@ public override string CreateQuery(string tableName,
801801
int top = 0,
802802
string? hints = null)
803803
{
804-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
804+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
805805

806806
// Validate the hints
807807
GuardHints(hints);
@@ -857,7 +857,7 @@ public override string CreateSkipQuery(string tableName,
857857
QueryGroup? where = null,
858858
string? hints = null)
859859
{
860-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
860+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
861861

862862
// Validate the hints
863863
GuardHints(hints);

src/RepoDb.Oracle/Resolvers/OracleDbTypeToClientTypeResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Regex RemoveParens
2222
/// <inheritdoc/>
2323
public Type Resolve(string dbTypeName)
2424
{
25-
ArgumentNullException.ThrowIfNullOrWhiteSpace(dbTypeName);
25+
ArgumentException.ThrowIfNullOrWhiteSpace(dbTypeName);
2626

2727
return dbTypeName.ToLowerInvariant() switch
2828
{

src/RepoDb.Oracle/StatementBuilders/OracleStatementBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override string CreateMerge(string tableName,
4444
IEnumerable<DbField> keyFields,
4545
IEnumerable<Field>? qualifiers, string? hints = null)
4646
{
47-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
47+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
4848
ArgumentNullException.ThrowIfNull(fields);
4949

5050
var primaryField = keyFields.FirstOrDefault(f => f.IsPrimary);
@@ -61,7 +61,7 @@ public override string CreateMerge(string tableName,
6161
throw new InvalidOperationException("Qualifiers must be specified for MERGE operation in Oracle.");
6262

6363
// Create SELECT :param AS Col1, :param AS Col2 ...
64-
var sourceColumns = string.Join(", ", fieldList.Select(f => $"{f.FieldName.AsParameter(true, DbSetting)} AS {f.FieldName.AsQuoted(DbSetting)}"));
64+
var sourceColumns = string.Join(", ", fieldList.Select(f => $"{f.FieldName.AsParameter(DbSetting)} AS {f.FieldName.AsQuoted(DbSetting)}"));
6565

6666
// ON condition
6767
var onConditions = string.Join(" AND ", qualifierList.Select(q =>
@@ -174,7 +174,7 @@ public override string CreateInsert(string tableName,
174174

175175
public override string CreateInsertAll(string tableName, IEnumerable<Field>? fields, int batchSize, IEnumerable<DbField> keyFields, string? hints = null)
176176
{
177-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
177+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
178178
GuardHints(hints);
179179

180180
var primaryField = keyFields.FirstOrDefault(f => f.IsPrimary);
@@ -218,7 +218,7 @@ public override string CreateQuery(string tableName,
218218
int top = 0,
219219
string? hints = null)
220220
{
221-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
221+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
222222

223223
// Validate the hints
224224
GuardHints(hints);
@@ -253,7 +253,7 @@ public override string CreateQuery(string tableName,
253253

254254
public override string CreateExists(string tableName, QueryGroup? where = null, string? hints = null)
255255
{
256-
ArgumentNullException.ThrowIfNullOrWhiteSpace(tableName);
256+
ArgumentException.ThrowIfNullOrWhiteSpace(tableName);
257257

258258
// Validate the hints
259259
GuardHints(hints);

src/RepoDb.PostgreSql.BulkOperations/Compiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ public static void SetProperty<TEntity>(TEntity instance,
10291029
object value)
10301030
where TEntity : class
10311031
{
1032-
var propertySetter = Compiler.GetPropertySetterFunc<TEntity>(propertyName);
1032+
var propertySetter = GetPropertySetterFunc<TEntity>(propertyName);
10331033
propertySetter?.Invoke(instance, value);
10341034
}
10351035

src/RepoDb.PostgreSql.BulkOperations/Extensions/NpgsqlText.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static string GetInsertCommandText(string sourceTableName,
5050
{
5151
fields = fields
5252
.Where(field =>
53-
!string.Equals(field.FieldName, identityField?.FieldName, System.StringComparison.OrdinalIgnoreCase));
53+
!string.Equals(field.FieldName, identityField?.FieldName, StringComparison.OrdinalIgnoreCase));
5454
}
5555

5656
// Build the query
@@ -612,7 +612,7 @@ private static void WriteInsertIntoTargetTableFromPseudoTableForMerge(QueryBuild
612612
{
613613
fields = fields
614614
.Where(field =>
615-
!string.Equals(field.FieldName, identityField?.FieldName, System.StringComparison.OrdinalIgnoreCase));
615+
!string.Equals(field.FieldName, identityField?.FieldName, StringComparison.OrdinalIgnoreCase));
616616
}
617617

618618
// Insert

src/RepoDb.PostgreSql/Resolvers/PostgreSqlDbTypeNameToClientTypeResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class PostgreSqlDbTypeNameToClientTypeResolver : IResolver<string, Type>
1515
/// <returns>The equivalent .NET CLR type.</returns>
1616
public virtual Type Resolve(string dbTypeName)
1717
{
18-
ArgumentNullException.ThrowIfNullOrWhiteSpace(dbTypeName);
18+
ArgumentException.ThrowIfNullOrWhiteSpace(dbTypeName);
1919

2020
/*
2121
"bigint" => typeof(Int64),

src/RepoDb.PostgreSql/Resolvers/PostgreSqlDbTypeNameToNpgsqlDbTypeResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class PostgreSqlDbTypeNameToNpgsqlDbTypeResolver : IResolver<string, Npgs
1515
/// <returns>The equivalent <see cref="NpgsqlDbType"/>.</returns>
1616
public virtual NpgsqlDbType? Resolve(string dbTypeName)
1717
{
18-
ArgumentNullException.ThrowIfNullOrWhiteSpace(dbTypeName);
18+
ArgumentException.ThrowIfNullOrWhiteSpace(dbTypeName);
1919

2020
// Try parse
2121
if (Enum.TryParse<NpgsqlDbType>(dbTypeName, true, out var result))

0 commit comments

Comments
 (0)