Skip to content

Commit ed881cb

Browse files
committed
Fix build errors
1 parent 947cab1 commit ed881cb

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

src/Examples/DapperExample/TranslationToSql/Builders/SqlQueryBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ private void AppendOnNewLine(string? value, StringBuilder builder)
452452
builder.AppendLine();
453453
}
454454

455-
builder.Append(new string(' ', _indentDepth * 4));
455+
builder.Append(' ', _indentDepth * 4);
456456
builder.Append(value);
457457
}
458458
}

src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private void WriteResult(StringBuilder builder, int indent, TimeSpan timeElapsed
263263

264264
private static void WriteIndent(StringBuilder builder, int indent)
265265
{
266-
builder.Append(new string(' ', indent * 2));
266+
builder.Append(' ', indent * 2);
267267
}
268268

269269
private void WritePadding(StringBuilder builder, int indent, int paddingLength)

src/JsonApiDotNetCore/Queries/IndentingStringWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public void WriteLine(string? line)
1212
{
1313
if (_indentDepth > 0)
1414
{
15-
_builder.Append(new string(' ', _indentDepth * 2));
15+
_builder.Append(' ', _indentDepth * 2);
1616
}
1717

1818
_builder.AppendLine(line);

test/OpenApiTests/AttributeTypes/AttributeTypeTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ namespace OpenApiTests.AttributeTypes;
88
public sealed class AttributeTypeTests : IClassFixture<OpenApiTestContext<AttributeTypesStartup, AttributeTypesDbContext>>
99
{
1010
public static readonly TheoryData<string> SchemaNames =
11-
[
12-
"attributesInCreateTypeContainerRequest",
13-
"attributesInUpdateTypeContainerRequest",
14-
"attributesInTypeContainerResponse"
15-
];
11+
#pragma warning disable CA1825 // Avoid zero-length array allocations
12+
// Justification: Workaround for bug https://github.com/dotnet/roslyn/issues/82484.
13+
[
14+
"attributesInCreateTypeContainerRequest",
15+
"attributesInUpdateTypeContainerRequest",
16+
"attributesInTypeContainerResponse"
17+
];
18+
#pragma warning restore CA1825 // Avoid zero-length array allocations
1619

1720
private readonly OpenApiTestContext<AttributeTypesStartup, AttributeTypesDbContext> _testContext;
1821

test/OpenApiTests/ModelStateValidation/ModelStateValidationTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ namespace OpenApiTests.ModelStateValidation;
88
public sealed class ModelStateValidationTests : IClassFixture<OpenApiTestContext<OpenApiStartup<ModelStateValidationDbContext>, ModelStateValidationDbContext>>
99
{
1010
public static readonly TheoryData<string> SchemaNames =
11-
[
12-
"attributesInCreateSocialMediaAccountRequest",
13-
"attributesInUpdateSocialMediaAccountRequest",
14-
"attributesInSocialMediaAccountResponse"
15-
];
11+
#pragma warning disable CA1825 // Avoid zero-length array allocations
12+
// Justification: Workaround for bug https://github.com/dotnet/roslyn/issues/82484.
13+
[
14+
"attributesInCreateSocialMediaAccountRequest",
15+
"attributesInUpdateSocialMediaAccountRequest",
16+
"attributesInSocialMediaAccountResponse"
17+
];
18+
#pragma warning restore CA1825 // Avoid zero-length array allocations
1619

1720
private readonly OpenApiTestContext<OpenApiStartup<ModelStateValidationDbContext>, ModelStateValidationDbContext> _testContext;
1821

test/TestBuildingBlocks/CapturingLoggerProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public sealed class CapturingLoggerProvider : ILoggerProvider
1616
private static readonly Func<string, LogLevel, bool> DefaultFilter = (_, _) => true;
1717
private readonly Func<string, LogLevel, bool> _filter;
1818

19+
// ReSharper disable once ChangeFieldTypeToSystemThreadingLock
20+
// Justification: Workaround for bug https://youtrack.jetbrains.com/issue/RSRP-503024/Regression-Use-System.Threading.Lock-on-.NET-11.
1921
private readonly LockPrimitive _lockObject = new();
2022
private readonly List<LogMessage> _messages = [];
2123

0 commit comments

Comments
 (0)