From 28747dfe5bafb585ac6ccecbfe92b9ca8b66b639 Mon Sep 17 00:00:00 2001 From: Neil Brommer Date: Thu, 28 Apr 2022 08:57:58 -0700 Subject: [PATCH] Upgrade to .NET 6 and update all dependencies --- .gitignore | 4 +- Start/Client/Start.Client.csproj | 24 +- Start/Client/wwwroot/index.html | 6 +- .../BookmarkContainersController.cs | 2 +- .../Controllers/BookmarkGroupsController.cs | 2 +- .../Server/Controllers/BookmarksController.cs | 2 +- Start/Server/Data/ApplicationDbContext.cs | 4 +- ...20220428155121_dotnet6_upgrade.Designer.cs | 547 ++++++++++++++++++ .../20220428155121_dotnet6_upgrade.cs | 51 ++ .../ApplicationDbContextModelSnapshot.cs | 65 ++- .../Data/Services/BookmarkContainerService.cs | 4 +- Start/Server/Start.Server.csproj | 21 +- Start/Shared/Start.Shared.csproj | 2 +- .../Client/Store/ContainerListTests.cs | 2 +- .../Client/Store/UnitTestWithFluxor.cs | 2 + Start_Tests/Server/UnitTestWithDb.cs | 2 +- Start_Tests/Start_Tests.csproj | 16 +- 17 files changed, 698 insertions(+), 58 deletions(-) create mode 100644 Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.Designer.cs create mode 100644 Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.cs diff --git a/.gitignore b/.gitignore index 761d773..67e0488 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ -# Project specific +# Project specific Start/Server/app.db +Start/Server/app.db-shm +Start/Server/app.db-wal # Compiled CSS files Start/Client/wwwRoot/css/ diff --git a/Start/Client/Start.Client.csproj b/Start/Client/Start.Client.csproj index 8c2aecb..005b675 100644 --- a/Start/Client/Start.Client.csproj +++ b/Start/Client/Start.Client.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 service-worker-assets.js enable Nullable @@ -45,17 +45,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/Start/Client/wwwroot/index.html b/Start/Client/wwwroot/index.html index ffe46aa..cd7353c 100644 --- a/Start/Client/wwwroot/index.html +++ b/Start/Client/wwwroot/index.html @@ -1,4 +1,4 @@ - + @@ -7,8 +7,6 @@ Start - - @@ -30,7 +28,7 @@
An unhandled error has occurred. Reload - 🗙 + ×
diff --git a/Start/Server/Controllers/BookmarkContainersController.cs b/Start/Server/Controllers/BookmarkContainersController.cs index c722afc..1b9e9ab 100644 --- a/Start/Server/Controllers/BookmarkContainersController.cs +++ b/Start/Server/Controllers/BookmarkContainersController.cs @@ -64,7 +64,7 @@ namespace Start.Server.Controllers { return Created( Url.Action(nameof(this.GetBookmarkContainer), - new { bookmarkContainerId = container.BookmarkContainerId }), + new { bookmarkContainerId = container.BookmarkContainerId })!, container); } diff --git a/Start/Server/Controllers/BookmarkGroupsController.cs b/Start/Server/Controllers/BookmarkGroupsController.cs index dff7bb2..7f9cb28 100644 --- a/Start/Server/Controllers/BookmarkGroupsController.cs +++ b/Start/Server/Controllers/BookmarkGroupsController.cs @@ -46,7 +46,7 @@ namespace Start.Server.Controllers { return Created( Url.Action(nameof(GetBookmarkGroup), - new { bookmarkGroupId = newGroup.BookmarkGroupId }), + new { bookmarkGroupId = newGroup.BookmarkGroupId })!, newGroup.MapToDto()); } diff --git a/Start/Server/Controllers/BookmarksController.cs b/Start/Server/Controllers/BookmarksController.cs index 4258ff7..510892e 100644 --- a/Start/Server/Controllers/BookmarksController.cs +++ b/Start/Server/Controllers/BookmarksController.cs @@ -47,7 +47,7 @@ namespace Start.Server.Controllers { return BadRequest(); return Created( - Url.Action(nameof(this.GetBookmark),new { bookmarkId = bookmark.BookmarkId }), + Url.Action(nameof(this.GetBookmark),new { bookmarkId = bookmark.BookmarkId })!, bookmark); } diff --git a/Start/Server/Data/ApplicationDbContext.cs b/Start/Server/Data/ApplicationDbContext.cs index 6691eb3..d2ea7e2 100644 --- a/Start/Server/Data/ApplicationDbContext.cs +++ b/Start/Server/Data/ApplicationDbContext.cs @@ -1,5 +1,4 @@ -using Start.Server.Models; -using IdentityServer4.EntityFramework.Options; +using Start.Server.Models; using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; @@ -7,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Duende.IdentityServer.EntityFramework.Options; namespace Start.Server.Data { public class ApplicationDbContext : ApiAuthorizationDbContext { diff --git a/Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.Designer.cs b/Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.Designer.cs new file mode 100644 index 0000000..836ea84 --- /dev/null +++ b/Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.Designer.cs @@ -0,0 +1,547 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Start.Server.Data; + +#nullable disable + +namespace Start.Server.Data.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20220428155121_dotnet6_upgrade")] + partial class dotnet6_upgrade + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "6.0.4"); + + modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b => + { + b.Property("UserCode") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("CreationTime") + .HasColumnType("TEXT"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("TEXT"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.HasKey("UserCode"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.ToTable("DeviceCodes", (string)null); + }); + + modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("Algorithm") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Created") + .HasColumnType("TEXT"); + + b.Property("Data") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DataProtected") + .HasColumnType("INTEGER"); + + b.Property("IsX509Certificate") + .HasColumnType("INTEGER"); + + b.Property("Use") + .HasColumnType("TEXT"); + + b.Property("Version") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Use"); + + b.ToTable("Keys"); + }); + + modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("ConsumedTime") + .HasColumnType("TEXT"); + + b.Property("CreationTime") + .HasColumnType("TEXT"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000) + .HasColumnType("TEXT"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Expiration") + .HasColumnType("TEXT"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Key"); + + b.HasIndex("ConsumedTime"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("PersistedGrants", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClaimType") + .HasColumnType("TEXT"); + + b.Property("ClaimValue") + .HasColumnType("TEXT"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClaimType") + .HasColumnType("TEXT"); + + b.Property("ClaimValue") + .HasColumnType("TEXT"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("ProviderKey") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("ProviderDisplayName") + .HasColumnType("TEXT"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("TEXT"); + + b.Property("LoginProvider") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Start.Server.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccessFailedCount") + .HasColumnType("INTEGER"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("EmailConfirmed") + .HasColumnType("INTEGER"); + + b.Property("LockoutEnabled") + .HasColumnType("INTEGER"); + + b.Property("LockoutEnd") + .HasColumnType("TEXT"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .HasColumnType("TEXT"); + + b.Property("PhoneNumber") + .HasColumnType("TEXT"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("INTEGER"); + + b.Property("SecurityStamp") + .HasColumnType("TEXT"); + + b.Property("TwoFactorEnabled") + .HasColumnType("INTEGER"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Start.Server.Models.Bookmark", b => + { + b.Property("BookmarkId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BookmarkGroupId") + .HasColumnType("INTEGER"); + + b.Property("Notes") + .HasMaxLength(5000) + .HasColumnType("TEXT"); + + b.Property("SortOrder") + .HasColumnType("INTEGER"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(2000) + .HasColumnType("TEXT"); + + b.HasKey("BookmarkId"); + + b.HasIndex("BookmarkGroupId"); + + b.ToTable("Bookmarks"); + }); + + modelBuilder.Entity("Start.Server.Models.BookmarkContainer", b => + { + b.Property("BookmarkContainerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ApplicationUserId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SortOrder") + .HasColumnType("INTEGER"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.HasKey("BookmarkContainerId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("BookmarkContainers"); + }); + + modelBuilder.Entity("Start.Server.Models.BookmarkGroup", b => + { + b.Property("BookmarkGroupId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BookmarkContainerId") + .HasColumnType("INTEGER"); + + b.Property("Color") + .IsRequired() + .HasMaxLength(6) + .HasColumnType("TEXT"); + + b.Property("SortOrder") + .HasColumnType("INTEGER"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.HasKey("BookmarkGroupId"); + + b.HasIndex("BookmarkContainerId"); + + b.ToTable("BookmarkGroups"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Start.Server.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Start.Server.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Start.Server.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Start.Server.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Start.Server.Models.Bookmark", b => + { + b.HasOne("Start.Server.Models.BookmarkGroup", "BookmarkGroup") + .WithMany("Bookmarks") + .HasForeignKey("BookmarkGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BookmarkGroup"); + }); + + modelBuilder.Entity("Start.Server.Models.BookmarkContainer", b => + { + b.HasOne("Start.Server.Models.ApplicationUser", "ApplicationUser") + .WithMany("BookmarkContainers") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ApplicationUser"); + }); + + modelBuilder.Entity("Start.Server.Models.BookmarkGroup", b => + { + b.HasOne("Start.Server.Models.BookmarkContainer", "BookmarkContainer") + .WithMany("BookmarkGroups") + .HasForeignKey("BookmarkContainerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BookmarkContainer"); + }); + + modelBuilder.Entity("Start.Server.Models.ApplicationUser", b => + { + b.Navigation("BookmarkContainers"); + }); + + modelBuilder.Entity("Start.Server.Models.BookmarkContainer", b => + { + b.Navigation("BookmarkGroups"); + }); + + modelBuilder.Entity("Start.Server.Models.BookmarkGroup", b => + { + b.Navigation("Bookmarks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.cs b/Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.cs new file mode 100644 index 0000000..e0a647e --- /dev/null +++ b/Start/Server/Data/Migrations/20220428155121_dotnet6_upgrade.cs @@ -0,0 +1,51 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Start.Server.Data.Migrations +{ + public partial class dotnet6_upgrade : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Keys", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + Version = table.Column(type: "INTEGER", nullable: false), + Created = table.Column(type: "TEXT", nullable: false), + Use = table.Column(type: "TEXT", nullable: true), + Algorithm = table.Column(type: "TEXT", maxLength: 100, nullable: false), + IsX509Certificate = table.Column(type: "INTEGER", nullable: false), + DataProtected = table.Column(type: "INTEGER", nullable: false), + Data = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Keys", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_PersistedGrants_ConsumedTime", + table: "PersistedGrants", + column: "ConsumedTime"); + + migrationBuilder.CreateIndex( + name: "IX_Keys_Use", + table: "Keys", + column: "Use"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Keys"); + + migrationBuilder.DropIndex( + name: "IX_PersistedGrants_ConsumedTime", + table: "PersistedGrants"); + } + } +} diff --git a/Start/Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Start/Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs index 560ad6a..ec66d04 100644 --- a/Start/Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Start/Server/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -5,6 +5,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Start.Server.Data; +#nullable disable + namespace Start.Server.Data.Migrations { [DbContext(typeof(ApplicationDbContext))] @@ -13,10 +15,9 @@ namespace Start.Server.Data.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "5.0.11"); + modelBuilder.HasAnnotation("ProductVersion", "6.0.4"); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.DeviceFlowCodes", b => { b.Property("UserCode") .HasMaxLength(200) @@ -63,10 +64,46 @@ namespace Start.Server.Data.Migrations b.HasIndex("Expiration"); - b.ToTable("DeviceCodes"); + b.ToTable("DeviceCodes", (string)null); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.Key", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("Algorithm") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Created") + .HasColumnType("TEXT"); + + b.Property("Data") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DataProtected") + .HasColumnType("INTEGER"); + + b.Property("IsX509Certificate") + .HasColumnType("INTEGER"); + + b.Property("Use") + .HasColumnType("TEXT"); + + b.Property("Version") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Use"); + + b.ToTable("Keys"); + }); + + modelBuilder.Entity("Duende.IdentityServer.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") .HasMaxLength(200) @@ -110,13 +147,15 @@ namespace Start.Server.Data.Migrations b.HasKey("Key"); + b.HasIndex("ConsumedTime"); + b.HasIndex("Expiration"); b.HasIndex("SubjectId", "ClientId", "Type"); b.HasIndex("SubjectId", "SessionId", "Type"); - b.ToTable("PersistedGrants"); + b.ToTable("PersistedGrants", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => @@ -142,7 +181,7 @@ namespace Start.Server.Data.Migrations .IsUnique() .HasDatabaseName("RoleNameIndex"); - b.ToTable("AspNetRoles"); + b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => @@ -165,7 +204,7 @@ namespace Start.Server.Data.Migrations b.HasIndex("RoleId"); - b.ToTable("AspNetRoleClaims"); + b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => @@ -188,7 +227,7 @@ namespace Start.Server.Data.Migrations b.HasIndex("UserId"); - b.ToTable("AspNetUserClaims"); + b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => @@ -212,7 +251,7 @@ namespace Start.Server.Data.Migrations b.HasIndex("UserId"); - b.ToTable("AspNetUserLogins"); + b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => @@ -227,7 +266,7 @@ namespace Start.Server.Data.Migrations b.HasIndex("RoleId"); - b.ToTable("AspNetUserRoles"); + b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => @@ -248,7 +287,7 @@ namespace Start.Server.Data.Migrations b.HasKey("UserId", "LoginProvider", "Name"); - b.ToTable("AspNetUserTokens"); + b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("Start.Server.Models.ApplicationUser", b => @@ -312,7 +351,7 @@ namespace Start.Server.Data.Migrations .IsUnique() .HasDatabaseName("UserNameIndex"); - b.ToTable("AspNetUsers"); + b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("Start.Server.Models.Bookmark", b => diff --git a/Start/Server/Data/Services/BookmarkContainerService.cs b/Start/Server/Data/Services/BookmarkContainerService.cs index de6a16f..8604904 100644 --- a/Start/Server/Data/Services/BookmarkContainerService.cs +++ b/Start/Server/Data/Services/BookmarkContainerService.cs @@ -20,7 +20,7 @@ namespace Start.Server.Data.Services { .Where(bc => bc.BookmarkContainerId == bookmarkContainerId) .If(includeGroups, q => q.Include(bc => bc.BookmarkGroups)) .If(includeBookmarks, q => q - .Include(bc => bc.BookmarkGroups) + .Include(bc => bc.BookmarkGroups!) .ThenInclude(bg => bg.Bookmarks)) .SingleOrDefaultAsync(); @@ -40,7 +40,7 @@ namespace Start.Server.Data.Services { .Where(bc => bc.ApplicationUserId == userId) .If(includeGroups, q => q.Include(bc => bc.BookmarkGroups)) .If(includeBookmarks, q => q - .Include(bc => bc.BookmarkGroups) + .Include(bc => bc.BookmarkGroups!) .ThenInclude(bg => bg.Bookmarks)) .ToListAsync(); } diff --git a/Start/Server/Start.Server.csproj b/Start/Server/Start.Server.csproj index 2b772f5..7cfb322 100644 --- a/Start/Server/Start.Server.csproj +++ b/Start/Server/Start.Server.csproj @@ -1,13 +1,13 @@ - net5.0 + net6.0 Start.Server-1D799CBA-C3C7-4198-970E-227998F2DFE2 enable Nullable - + @@ -19,15 +19,14 @@ - - - - - - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive +all + diff --git a/Start/Shared/Start.Shared.csproj b/Start/Shared/Start.Shared.csproj index 3aafd8a..ced4f70 100644 --- a/Start/Shared/Start.Shared.csproj +++ b/Start/Shared/Start.Shared.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable Nullable diff --git a/Start_Tests/Client/Store/ContainerListTests.cs b/Start_Tests/Client/Store/ContainerListTests.cs index 9e1cd6c..27849f6 100644 --- a/Start_Tests/Client/Store/ContainerListTests.cs +++ b/Start_Tests/Client/Store/ContainerListTests.cs @@ -10,7 +10,7 @@ namespace Start_Tests.Client.Store { [TestMethod] public void OnFetchContainersList() { - base.Store.Dispatch(new FetchContainerListAction()); + base.Dispatcher.Dispatch(new FetchContainerListAction()); Assert.IsTrue(base.State.Value.ContainerListState.IsLoadingContainersList); Assert.AreEqual(0, this.State.Value.ContainerListState.Containers.Count); diff --git a/Start_Tests/Client/Store/UnitTestWithFluxor.cs b/Start_Tests/Client/Store/UnitTestWithFluxor.cs index a820a9a..f5a417d 100644 --- a/Start_Tests/Client/Store/UnitTestWithFluxor.cs +++ b/Start_Tests/Client/Store/UnitTestWithFluxor.cs @@ -10,6 +10,7 @@ namespace Start_Tests.Client.Store { public abstract class UnitTestWithFluxor { protected IServiceProvider ServiceProvider { get; set; } protected IStore Store { get; set; } + protected IDispatcher Dispatcher { get; set; } protected IState State { get; set; } // Add child states in the individual tests @@ -30,6 +31,7 @@ namespace Start_Tests.Client.Store { .AddScoped(sp => new MockBookmarkContainersApi()); this.Store = this.BunitTc.Services.GetRequiredService(); + this.Dispatcher = this.BunitTc.Services.GetRequiredService(); this.State = this.BunitTc.Services.GetRequiredService>(); this.Store.InitializeAsync().Wait(); } diff --git a/Start_Tests/Server/UnitTestWithDb.cs b/Start_Tests/Server/UnitTestWithDb.cs index 25a77e8..242a289 100644 --- a/Start_Tests/Server/UnitTestWithDb.cs +++ b/Start_Tests/Server/UnitTestWithDb.cs @@ -1,5 +1,5 @@ using System; -using IdentityServer4.EntityFramework.Options; +using Duende.IdentityServer.EntityFramework.Options; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; diff --git a/Start_Tests/Start_Tests.csproj b/Start_Tests/Start_Tests.csproj index b969c26..d3be22c 100644 --- a/Start_Tests/Start_Tests.csproj +++ b/Start_Tests/Start_Tests.csproj @@ -1,18 +1,20 @@ - net5.0 + net6.0 false - - - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive +all + + +