Skip to content

Commit f0b6a2d

Browse files
committed
Package updates; run tests against EF Core 7
1 parent c7e396d commit f0b6a2d

File tree

8 files changed

+24
-17
lines changed

8 files changed

+24
-17
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]
1010
},
1111
"regitlint": {
12-
"version": "6.2.1",
12+
"version": "6.3.10",
1313
"commands": [
1414
"regitlint"
1515
]
@@ -21,7 +21,7 @@
2121
]
2222
},
2323
"dotnet-reportgenerator-globaltool": {
24-
"version": "5.1.11",
24+
"version": "5.1.15",
2525
"commands": [
2626
"reportgenerator"
2727
]

Directory.Build.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<PropertyGroup>
33
<TargetFrameworkName>net6.0</TargetFrameworkName>
44
<AspNetVersion>6.0.*</AspNetVersion>
5-
<EFCoreVersion>6.0.*</EFCoreVersion>
6-
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
7-
<MicrosoftCodeAnalysisVersion>4.3.*</MicrosoftCodeAnalysisVersion>
5+
<EFCoreVersion>7.0.*</EFCoreVersion>
6+
<EFCorePostgresVersion>7.0.*</EFCorePostgresVersion>
7+
<MicrosoftCodeAnalysisVersion>4.4.*</MicrosoftCodeAnalysisVersion>
88
<HumanizerVersion>2.14.1</HumanizerVersion>
99
<JsonApiDotNetCoreVersionPrefix>5.1.2</JsonApiDotNetCoreVersionPrefix>
1010
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
@@ -33,8 +33,8 @@
3333

3434
<!-- Test Project Dependencies -->
3535
<PropertyGroup>
36-
<CoverletVersion>3.2.0</CoverletVersion>
37-
<MoqVersion>4.18.2</MoqVersion>
38-
<TestSdkVersion>17.4.0</TestSdkVersion>
36+
<CoverletVersion>3.2.*</CoverletVersion>
37+
<MoqVersion>4.18.*</MoqVersion>
38+
<TestSdkVersion>17.4.*</TestSdkVersion>
3939
</PropertyGroup>
4040
</Project>

benchmarks/Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
13+
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
1414
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all">
1515
<!-- This reference solely exists to prevent build warnings for conflicting versions of Microsoft.CodeAnalysis. -->
1616
</PackageReference>

src/Examples/JsonApiDotNetCoreExample/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void ConfigureServices(WebApplicationBuilder builder)
4747

4848
builder.Services.AddDbContext<AppDbContext>(options =>
4949
{
50-
string connectionString = GetConnectionString(builder.Configuration);
50+
string? connectionString = GetConnectionString(builder.Configuration);
5151

5252
options.UseNpgsql(connectionString);
5353
#if DEBUG
@@ -73,10 +73,10 @@ static void ConfigureServices(WebApplicationBuilder builder)
7373
}
7474
}
7575

76-
static string GetConnectionString(IConfiguration configuration)
76+
static string? GetConnectionString(IConfiguration configuration)
7777
{
7878
string postgresPassword = Environment.GetEnvironmentVariable("PGPASSWORD") ?? "postgres";
79-
return configuration["Data:DefaultConnection"].Replace("###", postgresPassword);
79+
return configuration["Data:DefaultConnection"]?.Replace("###", postgresPassword);
8080
}
8181

8282
static void ConfigurePipeline(WebApplication webApplication)

src/Examples/NoEntityFrameworkExample/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Add services to the container.
99

10-
string connectionString = GetConnectionString(builder.Configuration);
10+
string? connectionString = GetConnectionString(builder.Configuration);
1111
builder.Services.AddNpgsql<AppDbContext>(connectionString);
1212

1313
builder.Services.AddJsonApi(options => options.Namespace = "api/v1", resources: resourceGraphBuilder => resourceGraphBuilder.Add<WorkItem, int>());
@@ -26,10 +26,10 @@
2626

2727
app.Run();
2828

29-
static string GetConnectionString(IConfiguration configuration)
29+
static string? GetConnectionString(IConfiguration configuration)
3030
{
3131
string postgresPassword = Environment.GetEnvironmentVariable("PGPASSWORD") ?? "postgres";
32-
return configuration["Data:DefaultConnection"].Replace("###", postgresPassword);
32+
return configuration["Data:DefaultConnection"]?.Replace("###", postgresPassword);
3333
}
3434

3535
static async Task CreateDatabaseAsync(IServiceProvider serviceProvider)

test/SourceGeneratorTests/CompilationBuilder.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ namespace SourceGeneratorTests;
99

1010
internal sealed class CompilationBuilder
1111
{
12-
private static readonly CSharpCompilationOptions DefaultOptions = new(OutputKind.DynamicallyLinkedLibrary);
12+
private static readonly CSharpCompilationOptions DefaultOptions =
13+
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary).WithSpecificDiagnosticOptions(new Dictionary<string, ReportDiagnostic>
14+
{
15+
// Suppress warning for version conflict on Microsoft.Extensions.Logging.Abstractions:
16+
// JsonApiDotNetCore indirectly depends on v6 (via Entity Framework Core 6), whereas Entity Framework Core 7 depends on v7.
17+
["CS1701"] = ReportDiagnostic.Suppress
18+
});
1319

1420
private readonly HashSet<SyntaxTree> _syntaxTrees = new();
1521
private readonly HashSet<MetadataReference> _references = new();

test/TestBuildingBlocks/FakeLoggerFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
5959
}
6060

6161
public IDisposable BeginScope<TState>(TState state)
62+
where TState : notnull
6263
{
6364
return NullScope.Instance;
6465
}

test/TestBuildingBlocks/TestBuildingBlocks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ItemGroup>
1111
<PackageReference Include="Bogus" Version="34.0.2" />
1212
<PackageReference Include="coverlet.collector" Version="$(CoverletVersion)" PrivateAssets="All" />
13-
<PackageReference Include="FluentAssertions" Version="6.8.0" />
13+
<PackageReference Include="FluentAssertions" Version="6.9.0" />
1414
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetVersion)" />
1515
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
1616
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />

0 commit comments

Comments
 (0)