Skip to content

Commit

Permalink
Add .NET 8 and drop .NET 7 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
glucaci authored Jul 10, 2024
1 parent d3a353e commit a60c5cd
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
dotnet-version: |
6
7
8
- name: Build, Test and Sonar
uses: swisslife-oss/actions/pull-request@main
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
dotnet-version: |
6
7
8
- name: Restore tools
run: dotnet tool restore
- name: Build, Test and Sonar
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<PackageVersion Include="System.Text.Json" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0'">
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion samples/Context/DataAccess/DataAccess.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>SimpleBlog.DataAccess</AssemblyName>
<RootNamespace>SimpleBlog.DataAccess</RootNamespace>
<IsPackable>false</IsPackable>
Expand Down
4 changes: 2 additions & 2 deletions samples/Context/Domain/Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>SimpleBlog.Domain</AssemblyName>
<RootNamespace>SimpleBlog.Domain</RootNamespace>
<IsPackable>false</IsPackable>
Expand All @@ -17,4 +17,4 @@
<ProjectReference Include="..\Models\Models.csproj" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion samples/Context/Host/Host.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>fbbac7be-63d2-4849-8dc4-31492a2367a2</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
Expand Down
2 changes: 1 addition & 1 deletion samples/Context/Host/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
}

app.UseOpenApi();
app.UseSwaggerUi3();
app.UseSwaggerUi();

app.UseHttpsRedirection();

Expand Down
4 changes: 2 additions & 2 deletions samples/Context/Models/Models.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyName>SimpleBlog.Models</AssemblyName>
<RootNamespace>SimpleBlog.Models</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion samples/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<ItemGroup>
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageVersion Include="NSwag.AspNetCore" Version="13.18.0" />
<PackageVersion Include="NSwag.AspNetCore" Version="14.0.8" />
<PackageVersion Include="MongoDB.Extensions.Migration" Version="1.4.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/Context.Tests/Context.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(CCTestProjectProps)" Condition="Exists('$(CCTestProjectProps)')" />
<PropertyGroup>

<PropertyGroup>
<AssemblyName>MongoDB.Extensions.Context.Tests</AssemblyName>
<RootNamespace>MongoDB.Extensions.Context.Tests</RootNamespace>
</PropertyGroup>
Expand All @@ -13,7 +13,7 @@

<ItemGroup>
<Compile Remove="IsExternalInit.cs" Condition="'$(TargetFramework)' == 'net6.0'" />
<Compile Remove="IsExternalInit.cs" Condition="'$(TargetFramework)' == 'net7.0'" />
<Compile Remove="IsExternalInit.cs" Condition="'$(TargetFramework)' == 'net8.0'" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/Context.Tests/MongoCollectionBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void AddBsonClassMap_AddNewBsonClassMapSeveralTimes_BsonClassMapIsRegiste
public void AddBsonClassMap_AddNewBsonClassMapWithoutParameter_BsonClassMapIsRegistered()
{
// Arrange
var mongoCollectionBuilder =
var mongoCollectionBuilder =
new MongoCollectionBuilder<ItemWithoutSpecificClassMap>(_mongoDatabase);

// Act
Expand Down Expand Up @@ -157,7 +157,7 @@ public void WithMongoCollectionSettings_ChangeCollectionSettings_MongoCollection
{
// Arrange
var mongoCollectionBuilder = new MongoCollectionBuilder<Order>(_mongoDatabase);

// Act
mongoCollectionBuilder.WithCollectionSettings(mongoCollectionSettings =>
{
Expand Down Expand Up @@ -230,7 +230,7 @@ public void WithMongoCollectionConfiguration_ChangeCollectionConfiguration_Mongo

IMongoCollection<Order> result = mongoCollectionBuilder.Build();

//
//
List<BsonDocument> indexes = result.Indexes.List().ToList();
Assert.Equal("_id_", indexes.First().GetElement("name").Value.ToString());
Assert.Equal("Name_1", indexes.Last().GetElement("name").Value.ToString(), ignoreCase: true);
Expand Down
6 changes: 3 additions & 3 deletions src/Context/IMongoCollectionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ public interface IMongoCollectionBuilder<TDocument>
{
IMongoCollectionBuilder<TDocument> WithCollectionName(string collectionName);

IMongoCollectionBuilder<TDocument> AddBsonClassMap<TMapDocument>()
IMongoCollectionBuilder<TDocument> AddBsonClassMap<TMapDocument>()
where TMapDocument : class;

IMongoCollectionBuilder<TDocument> AddBsonClassMap<TMapDocument>(
Action<BsonClassMap<TMapDocument>> bsonClassMapAction)
Action<BsonClassMap<TMapDocument>> bsonClassMapAction)
where TMapDocument : class;

IMongoCollectionBuilder<TDocument> WithCollectionSettings(
Action<MongoCollectionSettings> collectionSettings);

Expand Down
8 changes: 4 additions & 4 deletions src/Context/Internal/MongoCollectionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ public IMongoCollectionBuilder<TDocument> WithCollectionName(string collectionNa
public IMongoCollectionBuilder<TDocument> AddBsonClassMap<TMapDocument>(
Action<BsonClassMap<TMapDocument>> bsonClassMapAction) where TMapDocument : class
{
_classMapActions.Add(() =>
_classMapActions.Add(() =>
RegisterClassMapSync<TMapDocument>(bsonClassMapAction));

return this;
}

public IMongoCollectionBuilder<TDocument> AddBsonClassMap<TMapDocument>()
public IMongoCollectionBuilder<TDocument> AddBsonClassMap<TMapDocument>()
where TMapDocument : class
{
_classMapActions.Add(() =>
_classMapActions.Add(() =>
RegisterClassMapSync<TMapDocument>());

return this;
Expand All @@ -72,7 +72,7 @@ public IMongoCollectionBuilder<TDocument> WithCollectionConfiguration(
internal IMongoCollection<TDocument> Build()
{
_classMapActions.ForEach(action => action());

IMongoCollection<TDocument> mongoCollection = GetMongoCollection();

_collectionConfigurations.ForEach(configuration => configuration(mongoCollection));
Expand Down
4 changes: 2 additions & 2 deletions src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup Label="Framework Versions">
<TestProjectTargetFrameworks>net6.0;net7.0</TestProjectTargetFrameworks>
<ResourceProjectTargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0</ResourceProjectTargetFrameworks>
<TestProjectTargetFrameworks>net6.0;net8.0</TestProjectTargetFrameworks>
<ResourceProjectTargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</ResourceProjectTargetFrameworks>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Migration.Tests/Migration.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<AssemblyName>Migration.Tests</AssemblyName>
<RootNamespace>Migration.Tests</RootNamespace>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Migration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>MongoDB.Extensions.Migration</AssemblyName>
<RootNamespace>MongoDB.Extensions.Migration</RootNamespace>
<PackageId>MongoDB.Extensions.Migration</PackageId>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit a60c5cd

Please sign in to comment.