From ae7d0c944aff22bb7a8d4e7e5cacc5b8d75ae7dd Mon Sep 17 00:00:00 2001 From: Adam Russell Date: Mon, 11 Nov 2024 11:09:40 -0800 Subject: [PATCH] Updated to MongoDB.Driver 3.0, Straight Project Reference Updated to MongoDB.Driver 3.0 + other packages, updated to .NET 8, and changed MongoDbGenericRepository to straight project reference temporarily. --- AspNetCore.Identity.MongoDbCore.sln | 12 ++++++-- .../MongoIdentitySample.Mvc.csproj | 20 ++++++------- src/AspNetCore.Identity.MongoDbCore.csproj | 13 +++++---- ...entity.MongoDbCore.IntegrationTests.csproj | 29 ++++++++++--------- .../UserManagerTest.cs | 8 ++--- 5 files changed, 47 insertions(+), 35 deletions(-) diff --git a/AspNetCore.Identity.MongoDbCore.sln b/AspNetCore.Identity.MongoDbCore.sln index 6bc2801..51530c6 100644 --- a/AspNetCore.Identity.MongoDbCore.sln +++ b/AspNetCore.Identity.MongoDbCore.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.16 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35222.181 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Identity.MongoDbCore", "src\AspNetCore.Identity.MongoDbCore.csproj", "{C2EB6500-79A2-410E-8BF7-ACACE86C7A0E}" EndProject @@ -13,7 +13,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Identity.MongoDb EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{EE14D20F-C6E9-4A4C-A13E-C1A90BCA8763}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoIdentitySample.Mvc", "sample\MongoIdentitySample.Mvc\MongoIdentitySample.Mvc.csproj", "{B0F2EB41-D3DC-4A5B-A479-A1D2595CE620}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoIdentitySample.Mvc", "sample\MongoIdentitySample.Mvc\MongoIdentitySample.Mvc.csproj", "{B0F2EB41-D3DC-4A5B-A479-A1D2595CE620}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDbGenericRepository", "..\mongodb-generic-repository\MongoDbGenericRepository\MongoDbGenericRepository.csproj", "{B99D771B-ACBA-45FC-B634-4E2D71C651C2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -33,6 +35,10 @@ Global {B0F2EB41-D3DC-4A5B-A479-A1D2595CE620}.Debug|Any CPU.Build.0 = Debug|Any CPU {B0F2EB41-D3DC-4A5B-A479-A1D2595CE620}.Release|Any CPU.ActiveCfg = Release|Any CPU {B0F2EB41-D3DC-4A5B-A479-A1D2595CE620}.Release|Any CPU.Build.0 = Release|Any CPU + {B99D771B-ACBA-45FC-B634-4E2D71C651C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B99D771B-ACBA-45FC-B634-4E2D71C651C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B99D771B-ACBA-45FC-B634-4E2D71C651C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B99D771B-ACBA-45FC-B634-4E2D71C651C2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj b/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj index 460ff58..241255f 100644 --- a/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj +++ b/sample/MongoIdentitySample.Mvc/MongoIdentitySample.Mvc.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net8.0 OutOfProcess AspNetCoreModule @@ -9,15 +9,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/AspNetCore.Identity.MongoDbCore.csproj b/src/AspNetCore.Identity.MongoDbCore.csproj index 5a044a4..800e9c0 100644 --- a/src/AspNetCore.Identity.MongoDbCore.csproj +++ b/src/AspNetCore.Identity.MongoDbCore.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;netstandard2.1 + netstandard2.1 true true @@ -28,10 +28,13 @@ - - - - + + + + + + + diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj index 9adc918..a0df530 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.MongoDbCore.IntegrationTests.csproj @@ -1,29 +1,28 @@  - netcoreapp3.1 + net8.0 false - - - - - - - - - - - + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -34,4 +33,8 @@ Always + + + + diff --git a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.Test/UserManagerTest.cs b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.Test/UserManagerTest.cs index 88e4fa4..5d68992 100644 --- a/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.Test/UserManagerTest.cs +++ b/test/AspNetCore.Identity.MongoDbCore.IntegrationTests/AspNetCore.Identity.Test/UserManagerTest.cs @@ -682,7 +682,7 @@ namespace Microsoft.AspNetCore.Identity.Test } [Fact] - public void UserManagerWillUseTokenProviderInstance() + public async Task UserManagerWillUseTokenProviderInstanceAsync() { var provider = new ATokenProvider(); var config = new ConfigurationBuilder().Build(); @@ -695,11 +695,11 @@ namespace Microsoft.AspNetCore.Identity.Test ProviderInstance = provider })).AddUserStore(); var manager = services.BuildServiceProvider().GetService>(); - Assert.ThrowsAsync(() => manager.GenerateUserTokenAsync(new TestUser(), "A", "purpose")); + await Assert.ThrowsAsync(() => manager.GenerateUserTokenAsync(new TestUser(), "A", "purpose")); } [Fact] - public void UserManagerWillUseTokenProviderInstanceOverDefaults() + public async Task UserManagerWillUseTokenProviderInstanceOverDefaultsAsync() { var provider = new ATokenProvider(); var config = new ConfigurationBuilder().Build(); @@ -712,7 +712,7 @@ namespace Microsoft.AspNetCore.Identity.Test ProviderInstance = provider })).AddUserStore().AddDefaultTokenProviders(); var manager = services.BuildServiceProvider().GetService>(); - Assert.ThrowsAsync(() => manager.GenerateUserTokenAsync(new TestUser(), TokenOptions.DefaultProvider, "purpose")); + await Assert.ThrowsAsync(() => manager.GenerateUserTokenAsync(new TestUser(), TokenOptions.DefaultProvider, "purpose")); } [Fact]