diff --git a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj index eb88972c0..f19e84335 100644 --- a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj +++ b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj index 1e9508843..e0426f3bc 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj index a15e101d3..7309593a8 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj index 62373d1b3..cc16b89e1 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj @@ -6,12 +6,12 @@ - + - - + + diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj index 3de07e329..4b86c7234 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj index 1d4ea7a2d..37e038028 100644 --- a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj +++ b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index d6459698c..77d58aff1 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -24,13 +24,13 @@ - + - + diff --git a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj index e781b218d..294d3bcc3 100644 --- a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj +++ b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj @@ -17,7 +17,7 @@ - + @@ -29,8 +29,6 @@ - - diff --git a/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs b/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs index 5c7ecdef5..142cc51f1 100644 --- a/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs +++ b/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs @@ -5,7 +5,6 @@ using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; -using WebMVC.Models; using Xunit; namespace Basket.FunctionalTests @@ -74,7 +73,8 @@ namespace Basket.FunctionalTests string BuildCheckout() { - var checkoutBasket = new BasketDTO() + + var checkoutBasket = new { City = "city", Street = "street", diff --git a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj index bf5cb593a..d76680291 100644 --- a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj +++ b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj @@ -7,14 +7,14 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index e7c996586..af93035ec 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -39,9 +39,9 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs index e7ea1e09d..5d0e38bbf 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Options; using Model; using Polly; + using Polly.Retry; using System; using System.Collections.Generic; using System.Data.SqlClient; @@ -369,7 +370,7 @@ } } - private Policy CreatePolicy( ILogger logger, string prefix,int retries = 3) + private AsyncRetryPolicy CreatePolicy( ILogger logger, string prefix,int retries = 3) { return Policy.Handle(). WaitAndRetryAsync( diff --git a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj index 07e9e2991..04aeeb8ef 100644 --- a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj +++ b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj @@ -33,7 +33,7 @@ - + diff --git a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj index 6a9a2bf99..e69d785b1 100644 --- a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj +++ b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj @@ -7,7 +7,7 @@ - + all diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index fe4432af8..a6dea0d4b 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -17,20 +17,20 @@ - + - - + + - + diff --git a/src/Services/Identity/Identity.API/Migrations/20170912114036_Initial.Designer.cs b/src/Services/Identity/Identity.API/Migrations/20190301122307_Initial.Designer.cs similarity index 87% rename from src/Services/Identity/Identity.API/Migrations/20170912114036_Initial.Designer.cs rename to src/Services/Identity/Identity.API/Migrations/20190301122307_Initial.Designer.cs index 0850b37b9..591f24cb7 100644 --- a/src/Services/Identity/Identity.API/Migrations/20170912114036_Initial.Designer.cs +++ b/src/Services/Identity/Identity.API/Migrations/20190301122307_Initial.Designer.cs @@ -1,110 +1,26 @@ // +using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.eShopOnContainers.Services.Identity.API.Data; -using System; namespace Identity.API.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20170912114036_Initial")] + [Migration("20190301122307_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") + .HasAnnotation("ProductVersion", "2.2.1-servicing-10028") + .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("Identity.API.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("CardHolderName") - .IsRequired(); - - b.Property("CardNumber") - .IsRequired(); - - b.Property("CardType"); - - b.Property("City") - .IsRequired(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Country") - .IsRequired(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("Expiration") - .IsRequired(); - - b.Property("LastName") - .IsRequired(); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("Name") - .IsRequired(); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityNumber") - .IsRequired(); - - b.Property("SecurityStamp"); - - b.Property("State") - .IsRequired(); - - b.Property("Street") - .IsRequired(); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.Property("ZipCode") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") @@ -132,7 +48,8 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("ClaimType"); @@ -151,7 +68,8 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("ClaimType"); @@ -213,6 +131,92 @@ namespace Identity.API.Migrations b.ToTable("AspNetUserTokens"); }); + modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("CardHolderName") + .IsRequired(); + + b.Property("CardNumber") + .IsRequired(); + + b.Property("CardType"); + + b.Property("City") + .IsRequired(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Country") + .IsRequired(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("Expiration") + .IsRequired(); + + b.Property("LastName") + .IsRequired(); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("Name") + .IsRequired(); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityNumber") + .IsRequired(); + + b.Property("SecurityStamp"); + + b.Property("State") + .IsRequired(); + + b.Property("Street") + .IsRequired(); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.Property("ZipCode") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") @@ -223,7 +227,7 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); @@ -231,7 +235,7 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); @@ -244,7 +248,7 @@ namespace Identity.API.Migrations .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); @@ -252,7 +256,7 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); diff --git a/src/Services/Identity/Identity.API/Migrations/20170912114036_Initial.cs b/src/Services/Identity/Identity.API/Migrations/20190301122307_Initial.cs similarity index 58% rename from src/Services/Identity/Identity.API/Migrations/20170912114036_Initial.cs rename to src/Services/Identity/Identity.API/Migrations/20190301122307_Initial.cs index cf771dac8..f349645f8 100644 --- a/src/Services/Identity/Identity.API/Migrations/20170912114036_Initial.cs +++ b/src/Services/Identity/Identity.API/Migrations/20190301122307_Initial.cs @@ -1,7 +1,6 @@ -using Microsoft.EntityFrameworkCore.Metadata; +using System; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace Identity.API.Migrations { @@ -13,10 +12,10 @@ namespace Identity.API.Migrations name: "AspNetRoles", columns: table => new { - Id = table.Column(type: "nvarchar(450)", nullable: false), - ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true) + Id = table.Column(nullable: false), + Name = table.Column(maxLength: 256, nullable: true), + NormalizedName = table.Column(maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column(nullable: true) }, constraints: table => { @@ -27,33 +26,33 @@ namespace Identity.API.Migrations name: "AspNetUsers", columns: table => new { - Id = table.Column(type: "nvarchar(450)", nullable: false), - AccessFailedCount = table.Column(type: "int", nullable: false), - CardHolderName = table.Column(type: "nvarchar(max)", nullable: false), - CardNumber = table.Column(type: "nvarchar(max)", nullable: false), - CardType = table.Column(type: "int", nullable: false), - City = table.Column(type: "nvarchar(max)", nullable: false), - ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true), - Country = table.Column(type: "nvarchar(max)", nullable: false), - Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - EmailConfirmed = table.Column(type: "bit", nullable: false), - Expiration = table.Column(type: "nvarchar(max)", nullable: false), - LastName = table.Column(type: "nvarchar(max)", nullable: false), - LockoutEnabled = table.Column(type: "bit", nullable: false), - LockoutEnd = table.Column(type: "datetimeoffset", nullable: true), - Name = table.Column(type: "nvarchar(max)", nullable: false), - NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - PasswordHash = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true), - PhoneNumberConfirmed = table.Column(type: "bit", nullable: false), - SecurityNumber = table.Column(type: "nvarchar(max)", nullable: false), - SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true), - State = table.Column(type: "nvarchar(max)", nullable: false), - Street = table.Column(type: "nvarchar(max)", nullable: false), - TwoFactorEnabled = table.Column(type: "bit", nullable: false), - UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - ZipCode = table.Column(type: "nvarchar(max)", nullable: false) + Id = table.Column(nullable: false), + UserName = table.Column(maxLength: 256, nullable: true), + NormalizedUserName = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: true), + NormalizedEmail = table.Column(maxLength: 256, nullable: true), + EmailConfirmed = table.Column(nullable: false), + PasswordHash = table.Column(nullable: true), + SecurityStamp = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true), + PhoneNumberConfirmed = table.Column(nullable: false), + TwoFactorEnabled = table.Column(nullable: false), + LockoutEnd = table.Column(nullable: true), + LockoutEnabled = table.Column(nullable: false), + AccessFailedCount = table.Column(nullable: false), + CardNumber = table.Column(nullable: false), + SecurityNumber = table.Column(nullable: false), + Expiration = table.Column(nullable: false), + CardHolderName = table.Column(nullable: false), + CardType = table.Column(nullable: false), + Street = table.Column(nullable: false), + City = table.Column(nullable: false), + State = table.Column(nullable: false), + Country = table.Column(nullable: false), + ZipCode = table.Column(nullable: false), + Name = table.Column(nullable: false), + LastName = table.Column(nullable: false) }, constraints: table => { @@ -64,11 +63,11 @@ namespace Identity.API.Migrations name: "AspNetRoleClaims", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClaimType = table.Column(type: "nvarchar(max)", nullable: true), - ClaimValue = table.Column(type: "nvarchar(max)", nullable: true), - RoleId = table.Column(type: "nvarchar(450)", nullable: false) + RoleId = table.Column(nullable: false), + ClaimType = table.Column(nullable: true), + ClaimValue = table.Column(nullable: true) }, constraints: table => { @@ -85,11 +84,11 @@ namespace Identity.API.Migrations name: "AspNetUserClaims", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClaimType = table.Column(type: "nvarchar(max)", nullable: true), - ClaimValue = table.Column(type: "nvarchar(max)", nullable: true), - UserId = table.Column(type: "nvarchar(450)", nullable: false) + UserId = table.Column(nullable: false), + ClaimType = table.Column(nullable: true), + ClaimValue = table.Column(nullable: true) }, constraints: table => { @@ -106,10 +105,10 @@ namespace Identity.API.Migrations name: "AspNetUserLogins", columns: table => new { - LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), - ProviderKey = table.Column(type: "nvarchar(450)", nullable: false), - ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true), - UserId = table.Column(type: "nvarchar(450)", nullable: false) + LoginProvider = table.Column(nullable: false), + ProviderKey = table.Column(nullable: false), + ProviderDisplayName = table.Column(nullable: true), + UserId = table.Column(nullable: false) }, constraints: table => { @@ -126,8 +125,8 @@ namespace Identity.API.Migrations name: "AspNetUserRoles", columns: table => new { - UserId = table.Column(type: "nvarchar(450)", nullable: false), - RoleId = table.Column(type: "nvarchar(450)", nullable: false) + UserId = table.Column(nullable: false), + RoleId = table.Column(nullable: false) }, constraints: table => { @@ -150,10 +149,10 @@ namespace Identity.API.Migrations name: "AspNetUserTokens", columns: table => new { - UserId = table.Column(type: "nvarchar(450)", nullable: false), - LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), - Name = table.Column(type: "nvarchar(450)", nullable: false), - Value = table.Column(type: "nvarchar(max)", nullable: true) + UserId = table.Column(nullable: false), + LoginProvider = table.Column(nullable: false), + Name = table.Column(nullable: false), + Value = table.Column(nullable: true) }, constraints: table => { diff --git a/src/Services/Identity/Identity.API/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Services/Identity/Identity.API/Migrations/ApplicationDbContextModelSnapshot.cs index dcc87bc73..57c3fea70 100644 --- a/src/Services/Identity/Identity.API/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/src/Services/Identity/Identity.API/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,9 +1,10 @@ // +using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.eShopOnContainers.Services.Identity.API.Data; -using System; namespace Identity.API.Migrations { @@ -14,95 +15,10 @@ namespace Identity.API.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") + .HasAnnotation("ProductVersion", "2.2.1-servicing-10028") + .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("Identity.API.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("CardHolderName") - .IsRequired(); - - b.Property("CardNumber") - .IsRequired(); - - b.Property("CardType"); - - b.Property("City") - .IsRequired(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Country") - .IsRequired(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("Expiration") - .IsRequired(); - - b.Property("LastName") - .IsRequired(); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("Name") - .IsRequired(); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityNumber") - .IsRequired(); - - b.Property("SecurityStamp"); - - b.Property("State") - .IsRequired(); - - b.Property("Street") - .IsRequired(); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.Property("ZipCode") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") @@ -130,7 +46,8 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("ClaimType"); @@ -149,7 +66,8 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("ClaimType"); @@ -211,6 +129,92 @@ namespace Identity.API.Migrations b.ToTable("AspNetUserTokens"); }); + modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("CardHolderName") + .IsRequired(); + + b.Property("CardNumber") + .IsRequired(); + + b.Property("CardType"); + + b.Property("City") + .IsRequired(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Country") + .IsRequired(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("Expiration") + .IsRequired(); + + b.Property("LastName") + .IsRequired(); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("Name") + .IsRequired(); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("SecurityNumber") + .IsRequired(); + + b.Property("SecurityStamp"); + + b.Property("State") + .IsRequired(); + + b.Property("Street") + .IsRequired(); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.Property("ZipCode") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") @@ -221,7 +225,7 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); @@ -229,7 +233,7 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); @@ -242,7 +246,7 @@ namespace Identity.API.Migrations .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); @@ -250,7 +254,7 @@ namespace Identity.API.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.HasOne("Identity.API.Models.ApplicationUser") + b.HasOne("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); diff --git a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20170927170433_Config.Designer.cs b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20181129175524_Config.Designer.cs similarity index 71% rename from src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20170927170433_Config.Designer.cs rename to src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20181129175524_Config.Designer.cs index 327d2fee0..f8a7b6452 100644 --- a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20170927170433_Config.Designer.cs +++ b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20181129175524_Config.Designer.cs @@ -1,30 +1,33 @@ // +using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Identity.API.Migrations.ConfigurationDb { [DbContext(typeof(ConfigurationDbContext))] - [Migration("20170927170433_Config")] + [Migration("20181129175524_Config")] partial class Config { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") + .HasAnnotation("ProductVersion", "2.1.4-rtm-31024") + .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Created"); b.Property("Description") .HasMaxLength(1000); @@ -34,10 +37,16 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("Enabled"); + b.Property("LastAccessed"); + b.Property("Name") .IsRequired() .HasMaxLength(200); + b.Property("NonEditable"); + + b.Property("Updated"); + b.HasKey("Id"); b.HasIndex("Name") @@ -49,10 +58,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiResourceId") - .IsRequired(); + b.Property("ApiResourceId"); b.Property("Type") .IsRequired() @@ -65,13 +74,36 @@ namespace Identity.API.Migrations.ConfigurationDb b.ToTable("ApiClaims"); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ApiResourceId"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiProperties"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiResourceId") - .IsRequired(); + b.Property("ApiResourceId"); b.Property("Description") .HasMaxLength(1000); @@ -102,10 +134,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiScopeId") - .IsRequired(); + b.Property("ApiScopeId"); b.Property("Type") .IsRequired() @@ -121,10 +153,12 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiResourceId") - .IsRequired(); + b.Property("ApiResourceId"); + + b.Property("Created"); b.Property("Description") .HasMaxLength(1000); @@ -132,10 +166,12 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("Expiration"); b.Property("Type") + .IsRequired() .HasMaxLength(250); b.Property("Value") - .HasMaxLength(2000); + .IsRequired() + .HasMaxLength(4000); b.HasKey("Id"); @@ -147,7 +183,8 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("AbsoluteRefreshTokenLifetime"); @@ -189,9 +226,13 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("ConsentLifetime"); + b.Property("Created"); + b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -205,9 +246,13 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("IncludeJwtId"); + b.Property("LastAccessed"); + b.Property("LogoUri") .HasMaxLength(2000); + b.Property("NonEditable"); + b.Property("PairWiseSubjectSalt") .HasMaxLength(200); @@ -229,6 +274,13 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("Updated"); + + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -240,10 +292,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Type") .IsRequired() @@ -263,10 +315,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Origin") .IsRequired() @@ -282,10 +334,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("GrantType") .IsRequired() @@ -301,10 +353,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Provider") .IsRequired() @@ -320,10 +372,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("PostLogoutRedirectUri") .IsRequired() @@ -339,10 +391,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Key") .IsRequired() @@ -362,10 +414,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("RedirectUri") .IsRequired() @@ -381,10 +433,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Scope") .IsRequired() @@ -400,10 +452,12 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); + + b.Property("Created"); b.Property("Description") .HasMaxLength(2000); @@ -411,11 +465,12 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("Expiration"); b.Property("Type") + .IsRequired() .HasMaxLength(250); b.Property("Value") .IsRequired() - .HasMaxLength(2000); + .HasMaxLength(4000); b.HasKey("Id"); @@ -427,10 +482,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("IdentityResourceId") - .IsRequired(); + b.Property("IdentityResourceId"); b.Property("Type") .IsRequired() @@ -446,7 +501,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Created"); b.Property("Description") .HasMaxLength(1000); @@ -462,10 +520,14 @@ namespace Identity.API.Migrations.ConfigurationDb .IsRequired() .HasMaxLength(200); + b.Property("NonEditable"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); + b.Property("Updated"); + b.HasKey("Id"); b.HasIndex("Name") @@ -474,6 +536,29 @@ namespace Identity.API.Migrations.ConfigurationDb b.ToTable("IdentityResources"); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("IdentityResourceId"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityProperties"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") @@ -482,6 +567,14 @@ namespace Identity.API.Migrations.ConfigurationDb .OnDelete(DeleteBehavior.Cascade); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") @@ -585,6 +678,14 @@ namespace Identity.API.Migrations.ConfigurationDb .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade); }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); #pragma warning restore 612, 618 } } diff --git a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20170927170433_Config.cs b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20181129175524_Config.cs similarity index 62% rename from src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20170927170433_Config.cs rename to src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20181129175524_Config.cs index 754c75486..3b0f2dc42 100644 --- a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20170927170433_Config.cs +++ b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20181129175524_Config.cs @@ -1,6 +1,6 @@ -using Microsoft.EntityFrameworkCore.Metadata; +using System; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using System; namespace Identity.API.Migrations.ConfigurationDb { @@ -12,12 +12,16 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ApiResources", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Enabled = table.Column(type: "bit", nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + Enabled = table.Column(nullable: false), + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + Created = table.Column(nullable: false), + Updated = table.Column(nullable: true), + LastAccessed = table.Column(nullable: true), + NonEditable = table.Column(nullable: false) }, constraints: table => { @@ -28,42 +32,49 @@ namespace Identity.API.Migrations.ConfigurationDb name: "Clients", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - AbsoluteRefreshTokenLifetime = table.Column(type: "int", nullable: false), - AccessTokenLifetime = table.Column(type: "int", nullable: false), - AccessTokenType = table.Column(type: "int", nullable: false), - AllowAccessTokensViaBrowser = table.Column(type: "bit", nullable: false), - AllowOfflineAccess = table.Column(type: "bit", nullable: false), - AllowPlainTextPkce = table.Column(type: "bit", nullable: false), - AllowRememberConsent = table.Column(type: "bit", nullable: false), - AlwaysIncludeUserClaimsInIdToken = table.Column(type: "bit", nullable: false), - AlwaysSendClientClaims = table.Column(type: "bit", nullable: false), - AuthorizationCodeLifetime = table.Column(type: "int", nullable: false), - BackChannelLogoutSessionRequired = table.Column(type: "bit", nullable: false), - BackChannelLogoutUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - ClientClaimsPrefix = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - ClientName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - ClientUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - ConsentLifetime = table.Column(type: "int", nullable: true), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - EnableLocalLogin = table.Column(type: "bit", nullable: false), - Enabled = table.Column(type: "bit", nullable: false), - FrontChannelLogoutSessionRequired = table.Column(type: "bit", nullable: false), - FrontChannelLogoutUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - IdentityTokenLifetime = table.Column(type: "int", nullable: false), - IncludeJwtId = table.Column(type: "bit", nullable: false), - LogoUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - PairWiseSubjectSalt = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - ProtocolType = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - RefreshTokenExpiration = table.Column(type: "int", nullable: false), - RefreshTokenUsage = table.Column(type: "int", nullable: false), - RequireClientSecret = table.Column(type: "bit", nullable: false), - RequireConsent = table.Column(type: "bit", nullable: false), - RequirePkce = table.Column(type: "bit", nullable: false), - SlidingRefreshTokenLifetime = table.Column(type: "int", nullable: false), - UpdateAccessTokenClaimsOnRefresh = table.Column(type: "bit", nullable: false) + Enabled = table.Column(nullable: false), + ClientId = table.Column(maxLength: 200, nullable: false), + ProtocolType = table.Column(maxLength: 200, nullable: false), + RequireClientSecret = table.Column(nullable: false), + ClientName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + ClientUri = table.Column(maxLength: 2000, nullable: true), + LogoUri = table.Column(maxLength: 2000, nullable: true), + RequireConsent = table.Column(nullable: false), + AllowRememberConsent = table.Column(nullable: false), + AlwaysIncludeUserClaimsInIdToken = table.Column(nullable: false), + RequirePkce = table.Column(nullable: false), + AllowPlainTextPkce = table.Column(nullable: false), + AllowAccessTokensViaBrowser = table.Column(nullable: false), + FrontChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + FrontChannelLogoutSessionRequired = table.Column(nullable: false), + BackChannelLogoutUri = table.Column(maxLength: 2000, nullable: true), + BackChannelLogoutSessionRequired = table.Column(nullable: false), + AllowOfflineAccess = table.Column(nullable: false), + IdentityTokenLifetime = table.Column(nullable: false), + AccessTokenLifetime = table.Column(nullable: false), + AuthorizationCodeLifetime = table.Column(nullable: false), + ConsentLifetime = table.Column(nullable: true), + AbsoluteRefreshTokenLifetime = table.Column(nullable: false), + SlidingRefreshTokenLifetime = table.Column(nullable: false), + RefreshTokenUsage = table.Column(nullable: false), + UpdateAccessTokenClaimsOnRefresh = table.Column(nullable: false), + RefreshTokenExpiration = table.Column(nullable: false), + AccessTokenType = table.Column(nullable: false), + EnableLocalLogin = table.Column(nullable: false), + IncludeJwtId = table.Column(nullable: false), + AlwaysSendClientClaims = table.Column(nullable: false), + ClientClaimsPrefix = table.Column(maxLength: 200, nullable: true), + PairWiseSubjectSalt = table.Column(maxLength: 200, nullable: true), + Created = table.Column(nullable: false), + Updated = table.Column(nullable: true), + LastAccessed = table.Column(nullable: true), + UserSsoLifetime = table.Column(nullable: true), + UserCodeType = table.Column(maxLength: 100, nullable: true), + DeviceCodeLifetime = table.Column(nullable: false), + NonEditable = table.Column(nullable: false) }, constraints: table => { @@ -74,15 +85,18 @@ namespace Identity.API.Migrations.ConfigurationDb name: "IdentityResources", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Emphasize = table.Column(type: "bit", nullable: false), - Enabled = table.Column(type: "bit", nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Required = table.Column(type: "bit", nullable: false), - ShowInDiscoveryDocument = table.Column(type: "bit", nullable: false) + Enabled = table.Column(nullable: false), + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + Required = table.Column(nullable: false), + Emphasize = table.Column(nullable: false), + ShowInDiscoveryDocument = table.Column(nullable: false), + Created = table.Column(nullable: false), + Updated = table.Column(nullable: true), + NonEditable = table.Column(nullable: false) }, constraints: table => { @@ -93,10 +107,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ApiClaims", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ApiResourceId = table.Column(type: "int", nullable: false), - Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + Type = table.Column(maxLength: 200, nullable: false), + ApiResourceId = table.Column(nullable: false) }, constraints: table => { @@ -109,19 +123,40 @@ namespace Identity.API.Migrations.ConfigurationDb onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "ApiProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiProperties", x => x.Id); + table.ForeignKey( + name: "FK_ApiProperties_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "ApiScopes", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ApiResourceId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - DisplayName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Emphasize = table.Column(type: "bit", nullable: false), - Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - Required = table.Column(type: "bit", nullable: false), - ShowInDiscoveryDocument = table.Column(type: "bit", nullable: false) + Name = table.Column(maxLength: 200, nullable: false), + DisplayName = table.Column(maxLength: 200, nullable: true), + Description = table.Column(maxLength: 1000, nullable: true), + Required = table.Column(nullable: false), + Emphasize = table.Column(nullable: false), + ShowInDiscoveryDocument = table.Column(nullable: false), + ApiResourceId = table.Column(nullable: false) }, constraints: table => { @@ -138,13 +173,14 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ApiSecrets", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ApiResourceId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), - Expiration = table.Column(type: "datetime2", nullable: true), - Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true) + Description = table.Column(maxLength: 1000, nullable: true), + Value = table.Column(maxLength: 4000, nullable: false), + Expiration = table.Column(nullable: true), + Type = table.Column(maxLength: 250, nullable: false), + Created = table.Column(nullable: false), + ApiResourceId = table.Column(nullable: false) }, constraints: table => { @@ -161,11 +197,11 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientClaims", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), - Value = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false) + Type = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 250, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -182,10 +218,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientCorsOrigins", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - Origin = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false) + Origin = table.Column(maxLength: 150, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -202,10 +238,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientGrantTypes", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - GrantType = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false) + GrantType = table.Column(maxLength: 250, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -222,10 +258,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientIdPRestrictions", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - Provider = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + Provider = table.Column(maxLength: 200, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -242,10 +278,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientPostLogoutRedirectUris", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - PostLogoutRedirectUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + PostLogoutRedirectUri = table.Column(maxLength: 2000, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -262,11 +298,11 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientProperties", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - Key = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), - Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -283,10 +319,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientRedirectUris", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - RedirectUri = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + RedirectUri = table.Column(maxLength: 2000, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -303,10 +339,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientScopes", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - Scope = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + Scope = table.Column(maxLength: 200, nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -323,13 +359,14 @@ namespace Identity.API.Migrations.ConfigurationDb name: "ClientSecrets", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ClientId = table.Column(type: "int", nullable: false), - Description = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), - Expiration = table.Column(type: "datetime2", nullable: true), - Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), - Value = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: false) + Description = table.Column(maxLength: 2000, nullable: true), + Value = table.Column(maxLength: 4000, nullable: false), + Expiration = table.Column(nullable: true), + Type = table.Column(maxLength: 250, nullable: false), + Created = table.Column(nullable: false), + ClientId = table.Column(nullable: false) }, constraints: table => { @@ -346,10 +383,10 @@ namespace Identity.API.Migrations.ConfigurationDb name: "IdentityClaims", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - IdentityResourceId = table.Column(type: "int", nullable: false), - Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + Type = table.Column(maxLength: 200, nullable: false), + IdentityResourceId = table.Column(nullable: false) }, constraints: table => { @@ -362,14 +399,35 @@ namespace Identity.API.Migrations.ConfigurationDb onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "IdentityProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false), + IdentityResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityProperties", x => x.Id); + table.ForeignKey( + name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "ApiScopeClaims", columns: table => new { - Id = table.Column(type: "int", nullable: false) + Id = table.Column(nullable: false) .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - ApiScopeId = table.Column(type: "int", nullable: false), - Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + Type = table.Column(maxLength: 200, nullable: false), + ApiScopeId = table.Column(nullable: false) }, constraints: table => { @@ -387,6 +445,11 @@ namespace Identity.API.Migrations.ConfigurationDb table: "ApiClaims", column: "ApiResourceId"); + migrationBuilder.CreateIndex( + name: "IX_ApiProperties_ApiResourceId", + table: "ApiProperties", + column: "ApiResourceId"); + migrationBuilder.CreateIndex( name: "IX_ApiResources_Name", table: "ApiResources", @@ -470,6 +533,11 @@ namespace Identity.API.Migrations.ConfigurationDb table: "IdentityClaims", column: "IdentityResourceId"); + migrationBuilder.CreateIndex( + name: "IX_IdentityProperties_IdentityResourceId", + table: "IdentityProperties", + column: "IdentityResourceId"); + migrationBuilder.CreateIndex( name: "IX_IdentityResources_Name", table: "IdentityResources", @@ -482,6 +550,9 @@ namespace Identity.API.Migrations.ConfigurationDb migrationBuilder.DropTable( name: "ApiClaims"); + migrationBuilder.DropTable( + name: "ApiProperties"); + migrationBuilder.DropTable( name: "ApiScopeClaims"); @@ -518,6 +589,9 @@ namespace Identity.API.Migrations.ConfigurationDb migrationBuilder.DropTable( name: "IdentityClaims"); + migrationBuilder.DropTable( + name: "IdentityProperties"); + migrationBuilder.DropTable( name: "ApiScopes"); diff --git a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs index 88d9baba3..99c738d5a 100644 --- a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs +++ b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/ConfigurationDbContextModelSnapshot.cs @@ -1,12 +1,10 @@ // +using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Identity.API.Migrations.ConfigurationDb { @@ -17,13 +15,17 @@ namespace Identity.API.Migrations.ConfigurationDb { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") + .HasAnnotation("ProductVersion", "2.1.4-rtm-31024") + .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Created"); b.Property("Description") .HasMaxLength(1000); @@ -33,10 +35,16 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("Enabled"); + b.Property("LastAccessed"); + b.Property("Name") .IsRequired() .HasMaxLength(200); + b.Property("NonEditable"); + + b.Property("Updated"); + b.HasKey("Id"); b.HasIndex("Name") @@ -48,10 +56,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiResourceId") - .IsRequired(); + b.Property("ApiResourceId"); b.Property("Type") .IsRequired() @@ -64,13 +72,36 @@ namespace Identity.API.Migrations.ConfigurationDb b.ToTable("ApiClaims"); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ApiResourceId"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiProperties"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiResourceId") - .IsRequired(); + b.Property("ApiResourceId"); b.Property("Description") .HasMaxLength(1000); @@ -101,10 +132,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiScopeId") - .IsRequired(); + b.Property("ApiScopeId"); b.Property("Type") .IsRequired() @@ -120,10 +151,12 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiResourceId") - .IsRequired(); + b.Property("ApiResourceId"); + + b.Property("Created"); b.Property("Description") .HasMaxLength(1000); @@ -131,10 +164,12 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("Expiration"); b.Property("Type") + .IsRequired() .HasMaxLength(250); b.Property("Value") - .HasMaxLength(2000); + .IsRequired() + .HasMaxLength(4000); b.HasKey("Id"); @@ -146,7 +181,8 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("AbsoluteRefreshTokenLifetime"); @@ -188,9 +224,13 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("ConsentLifetime"); + b.Property("Created"); + b.Property("Description") .HasMaxLength(1000); + b.Property("DeviceCodeLifetime"); + b.Property("EnableLocalLogin"); b.Property("Enabled"); @@ -204,9 +244,13 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("IncludeJwtId"); + b.Property("LastAccessed"); + b.Property("LogoUri") .HasMaxLength(2000); + b.Property("NonEditable"); + b.Property("PairWiseSubjectSalt") .HasMaxLength(200); @@ -228,6 +272,13 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("UpdateAccessTokenClaimsOnRefresh"); + b.Property("Updated"); + + b.Property("UserCodeType") + .HasMaxLength(100); + + b.Property("UserSsoLifetime"); + b.HasKey("Id"); b.HasIndex("ClientId") @@ -239,10 +290,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Type") .IsRequired() @@ -262,10 +313,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Origin") .IsRequired() @@ -281,10 +332,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("GrantType") .IsRequired() @@ -300,10 +351,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Provider") .IsRequired() @@ -319,10 +370,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("PostLogoutRedirectUri") .IsRequired() @@ -338,10 +389,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Key") .IsRequired() @@ -361,10 +412,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("RedirectUri") .IsRequired() @@ -380,10 +431,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); b.Property("Scope") .IsRequired() @@ -399,10 +450,12 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ClientId") - .IsRequired(); + b.Property("ClientId"); + + b.Property("Created"); b.Property("Description") .HasMaxLength(2000); @@ -410,11 +463,12 @@ namespace Identity.API.Migrations.ConfigurationDb b.Property("Expiration"); b.Property("Type") + .IsRequired() .HasMaxLength(250); b.Property("Value") .IsRequired() - .HasMaxLength(2000); + .HasMaxLength(4000); b.HasKey("Id"); @@ -426,10 +480,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("IdentityResourceId") - .IsRequired(); + b.Property("IdentityResourceId"); b.Property("Type") .IsRequired() @@ -445,7 +499,10 @@ namespace Identity.API.Migrations.ConfigurationDb modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Created"); b.Property("Description") .HasMaxLength(1000); @@ -461,10 +518,14 @@ namespace Identity.API.Migrations.ConfigurationDb .IsRequired() .HasMaxLength(200); + b.Property("NonEditable"); + b.Property("Required"); b.Property("ShowInDiscoveryDocument"); + b.Property("Updated"); + b.HasKey("Id"); b.HasIndex("Name") @@ -473,6 +534,29 @@ namespace Identity.API.Migrations.ConfigurationDb b.ToTable("IdentityResources"); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("IdentityResourceId"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityProperties"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") @@ -481,6 +565,14 @@ namespace Identity.API.Migrations.ConfigurationDb .OnDelete(DeleteBehavior.Cascade); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") @@ -584,6 +676,14 @@ namespace Identity.API.Migrations.ConfigurationDb .HasForeignKey("IdentityResourceId") .OnDelete(DeleteBehavior.Cascade); }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade); + }); #pragma warning restore 612, 618 } } diff --git a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20170927170423_Grants.cs b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20170927170423_Grants.cs deleted file mode 100644 index 4017f8bf0..000000000 --- a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20170927170423_Grants.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; - -namespace Identity.API.Migrations.PersistedGrantDb -{ - public partial class Grants : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "PersistedGrants", - columns: table => new - { - Key = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - ClientId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - Data = table.Column(type: "nvarchar(max)", maxLength: 50000, nullable: false), - Expiration = table.Column(type: "datetime2", nullable: true), - SubjectId = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PersistedGrants", x => x.Key); - }); - - migrationBuilder.CreateIndex( - name: "IX_PersistedGrants_SubjectId_ClientId_Type", - table: "PersistedGrants", - columns: new[] { "SubjectId", "ClientId", "Type" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PersistedGrants"); - } - } -} diff --git a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20170927170423_Grants.Designer.cs b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20181129175506_Grants.Designer.cs similarity index 55% rename from src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20170927170423_Grants.Designer.cs rename to src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20181129175506_Grants.Designer.cs index aaf24d10c..6d22eb465 100644 --- a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20170927170423_Grants.Designer.cs +++ b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20181129175506_Grants.Designer.cs @@ -1,25 +1,60 @@ // +using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Identity.API.Migrations.PersistedGrantDb { [DbContext(typeof(PersistedGrantDbContext))] - [Migration("20170927170423_Grants")] + [Migration("20181129175506_Grants")] partial class Grants { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") + .HasAnnotation("ProductVersion", "2.1.4-rtm-31024") + .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + { + b.Property("UserCode") + .ValueGeneratedOnAdd() + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200); + + b.Property("CreationTime"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired(); + + b.Property("SubjectId") + .HasMaxLength(200); + + b.HasKey("UserCode"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.ToTable("DeviceCodes"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") diff --git a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20181129175506_Grants.cs b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20181129175506_Grants.cs new file mode 100644 index 000000000..e6835eab3 --- /dev/null +++ b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20181129175506_Grants.cs @@ -0,0 +1,65 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Identity.API.Migrations.PersistedGrantDb +{ + public partial class Grants : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "DeviceCodes", + columns: table => new + { + DeviceCode = table.Column(maxLength: 200, nullable: false), + UserCode = table.Column(maxLength: 200, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + CreationTime = table.Column(nullable: false), + Expiration = table.Column(nullable: false), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DeviceCodes", x => x.UserCode); + }); + + migrationBuilder.CreateTable( + name: "PersistedGrants", + columns: table => new + { + Key = table.Column(maxLength: 200, nullable: false), + Type = table.Column(maxLength: 50, nullable: false), + SubjectId = table.Column(maxLength: 200, nullable: true), + ClientId = table.Column(maxLength: 200, nullable: false), + CreationTime = table.Column(nullable: false), + Expiration = table.Column(nullable: true), + Data = table.Column(maxLength: 50000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PersistedGrants", x => x.Key); + }); + + migrationBuilder.CreateIndex( + name: "IX_DeviceCodes_DeviceCode", + table: "DeviceCodes", + column: "DeviceCode", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_PersistedGrants_SubjectId_ClientId_Type", + table: "PersistedGrants", + columns: new[] { "SubjectId", "ClientId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "DeviceCodes"); + + migrationBuilder.DropTable( + name: "PersistedGrants"); + } + } +} diff --git a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs index 7989f0586..c4657cbad 100644 --- a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs +++ b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/PersistedGrantDbContextModelSnapshot.cs @@ -1,11 +1,10 @@ // +using System; using IdentityServer4.EntityFramework.DbContexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Identity.API.Migrations.PersistedGrantDb { @@ -16,9 +15,44 @@ namespace Identity.API.Migrations.PersistedGrantDb { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452") + .HasAnnotation("ProductVersion", "2.1.4-rtm-31024") + .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + { + b.Property("UserCode") + .ValueGeneratedOnAdd() + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200); + + b.Property("CreationTime"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired(); + + b.Property("SubjectId") + .HasMaxLength(200); + + b.HasKey("UserCode"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.ToTable("DeviceCodes"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => { b.Property("Key") diff --git a/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml b/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml index 03f026bda..547415e53 100644 --- a/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml +++ b/src/Services/Identity/Identity.API/Views/Consent/Index.cshtml @@ -16,7 +16,7 @@
- @Html.Partial("_ValidationSummary") + @await Html.PartialAsync("_ValidationSummary")
@@ -49,7 +49,7 @@
    @foreach (var scope in Model.ResourceScopes) { - @Html.Partial("_ScopeListItem", scope) + @await Html.PartialAsync("_ScopeListItem", scope) }
diff --git a/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs b/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs index 91d00a4f3..ec6be38d1 100644 --- a/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs +++ b/src/Services/Location/Locations.API/Infrastructure/LocationsContextSeed.cs @@ -13,7 +13,7 @@ public class LocationsContextSeed { private static LocationsContext ctx; - public static async Task SeedAsync(IApplicationBuilder applicationBuilder, ILoggerFactory loggerFactory) + public static async Task SeedAsync(IApplicationBuilder applicationBuilder) { var config = applicationBuilder .ApplicationServices.GetRequiredService>(); diff --git a/src/Services/Location/Locations.API/Locations.API.csproj b/src/Services/Location/Locations.API/Locations.API.csproj index 247865c85..f7f0ff3c8 100644 --- a/src/Services/Location/Locations.API/Locations.API.csproj +++ b/src/Services/Location/Locations.API/Locations.API.csproj @@ -10,9 +10,9 @@ - + @@ -20,13 +20,13 @@ - - - - + + + + - +
diff --git a/src/Services/Location/Locations.API/Startup.cs b/src/Services/Location/Locations.API/Startup.cs index f92000b84..d18769fcc 100644 --- a/src/Services/Location/Locations.API/Startup.cs +++ b/src/Services/Location/Locations.API/Startup.cs @@ -188,7 +188,7 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API c.OAuthAppName("Locations Swagger UI"); }); - LocationsContextSeed.SeedAsync(app, loggerFactory) + LocationsContextSeed.SeedAsync(app) .Wait(); } diff --git a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj index 0b7e0a3c4..a1ad058cb 100644 --- a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj +++ b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs b/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs index c42b1975e..8d7091804 100644 --- a/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs +++ b/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs @@ -3,6 +3,7 @@ using Microsoft.eShopOnContainers.Services.Marketing.API.Model; using Microsoft.Extensions.Logging; using Polly; + using Polly.Retry; using System; using System.Collections.Generic; using System.Data.SqlClient; @@ -68,7 +69,7 @@ }; } - private Policy CreatePolicy(int retries, ILogger logger, string prefix) + private AsyncRetryPolicy CreatePolicy(int retries, ILogger logger, string prefix) { return Policy.Handle(). WaitAndRetryAsync( diff --git a/src/Services/Marketing/Marketing.API/Marketing.API.csproj b/src/Services/Marketing/Marketing.API/Marketing.API.csproj index 23116cc28..8efd65ef2 100644 --- a/src/Services/Marketing/Marketing.API/Marketing.API.csproj +++ b/src/Services/Marketing/Marketing.API/Marketing.API.csproj @@ -26,9 +26,9 @@ - + @@ -36,13 +36,13 @@ - - - - + + + + - + diff --git a/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj b/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj index ae4f51ed7..743f2fb1d 100644 --- a/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj +++ b/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs index 2c315248b..e210f7bd2 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs @@ -4,7 +4,6 @@ using global::Ordering.API.Application.Models; using MediatR; using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services; - using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency; using System; using System.Collections.Generic; using System.Linq; @@ -16,7 +15,6 @@ public class CreateOrderDraftCommandHandler : IRequestHandler { - private readonly IOrderRepository _orderRepository; private readonly IIdentityService _identityService; private readonly IMediator _mediator; diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs index 5c82b3952..975fb9a6a 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs @@ -10,6 +10,7 @@ using Microsoft.Extensions.Options; using Ordering.Infrastructure; using Polly; + using Polly.Retry; using System; using System.Collections.Generic; using System.Data.SqlClient; @@ -174,7 +175,7 @@ } - private Policy CreatePolicy( ILogger logger, string prefix, int retries =3) + private AsyncRetryPolicy CreatePolicy( ILogger logger, string prefix, int retries =3) { return Policy.Handle(). WaitAndRetryAsync( diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index ff8ae6607..f69c6f673 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -31,11 +31,11 @@ - - - + + + @@ -43,14 +43,14 @@ - + - + - + diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj index bd31074e7..b4ee75da7 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj index f79d76c60..f2c58a14a 100644 --- a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj +++ b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj index 93f6bfb88..394e7a1a7 100644 --- a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj +++ b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs index ac9ec608f..c0e37fb14 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs @@ -128,6 +128,11 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure return Task.CompletedTask; } + public Task Publish(object notification, CancellationToken cancellationToken = default(CancellationToken)) + { + return Task.CompletedTask; + } + public Task Send(IRequest request, CancellationToken cancellationToken = default(CancellationToken)) { return Task.FromResult(default(TResponse)); diff --git a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj index bca77a619..1bd2334b4 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj +++ b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj b/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj index 6a3d3c284..ac61a4ec3 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj +++ b/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj @@ -7,14 +7,14 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index 6a00a1699..a91fc6797 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -10,9 +10,9 @@ - + diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index 7dea3fc64..f65e0c441 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -10,15 +10,15 @@ - + - + diff --git a/src/Web/WebMVC/Services/BasketService.cs b/src/Web/WebMVC/Services/BasketService.cs index 7dffd934b..41a0fd207 100644 --- a/src/Web/WebMVC/Services/BasketService.cs +++ b/src/Web/WebMVC/Services/BasketService.cs @@ -17,8 +17,6 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services private readonly string _basketByPassUrl; private readonly string _purchaseUrl; - private readonly string _bffUrl; - public BasketService(HttpClient httpClient, IOptions settings) { _apiClient = httpClient; diff --git a/src/Web/WebMVC/Views/Campaigns/Details.cshtml b/src/Web/WebMVC/Views/Campaigns/Details.cshtml index df3b600e1..219fb40fb 100644 --- a/src/Web/WebMVC/Views/Campaigns/Details.cshtml +++ b/src/Web/WebMVC/Views/Campaigns/Details.cshtml @@ -8,7 +8,7 @@ -@Html.Partial("_Header", new List
() { +@await Html.PartialAsync("_Header", new List
() { new Header() { Controller = "Catalog", Text = "Back to catalog" }, new Header() { Controller = "Campaigns", Text = "Back to Campaigns" } }) diff --git a/src/Web/WebMVC/Views/Campaigns/Index.cshtml b/src/Web/WebMVC/Views/Campaigns/Index.cshtml index 7bfe7edd5..4d424b844 100644 --- a/src/Web/WebMVC/Views/Campaigns/Index.cshtml +++ b/src/Web/WebMVC/Views/Campaigns/Index.cshtml @@ -1,6 +1,6 @@ @{ ViewData["Title"] = "Campaigns"; -@model WebMVC.ViewModels.CampaignViewModel + @model WebMVC.ViewModels.CampaignViewModel }
@@ -9,7 +9,7 @@
-@Html.Partial("_Header", new List
() { +@await Html.PartialAsync("_Header", new List
() { new Header() { Controller = "Catalog", Text = "Back to catalog" } })
@@ -52,25 +52,25 @@

- @if (Model != null && Model.CampaignItems !=null && Model.CampaignItems.Any()) - { -
- @foreach (var catalogItem in Model.CampaignItems) - { -
- @Html.Partial("_campaign", catalogItem) -
- } -
+ @if (Model != null && Model.CampaignItems != null && Model.CampaignItems.Any()) + { +
+ @foreach (var catalogItem in Model.CampaignItems) + { +
+ @await Html.PartialAsync("_campaign", catalogItem) +
+ } +
- @Html.Partial("_pagination", Model.PaginationInfo) - } - else - { -
- THERE ARE NO CAMPAIGNS -
- } + @await Html.PartialAsync("_pagination", Model.PaginationInfo) + } + else + { +
+ THERE ARE NO CAMPAIGNS +
+ } diff --git a/src/Web/WebMVC/Views/Cart/Index.cshtml b/src/Web/WebMVC/Views/Cart/Index.cshtml index d9386a1fd..5e7455eb7 100644 --- a/src/Web/WebMVC/Views/Cart/Index.cshtml +++ b/src/Web/WebMVC/Views/Cart/Index.cshtml @@ -10,7 +10,7 @@
- @Html.Partial("_Header", new List
() { + @await Html.PartialAsync("_Header", new List
() { new Header() { Controller = "Catalog", Text = "Back to catalog" } }) @await Component.InvokeAsync("CartList", new { user = UserManager.Parse(User) }) diff --git a/src/Web/WebMVC/Views/Catalog/Index.cshtml b/src/Web/WebMVC/Views/Catalog/Index.cshtml index c2ef7f367..77d282b7e 100644 --- a/src/Web/WebMVC/Views/Catalog/Index.cshtml +++ b/src/Web/WebMVC/Views/Catalog/Index.cshtml @@ -35,18 +35,18 @@ @if (Model.CatalogItems.Count() > 0) { - @Html.Partial("_pagination", Model.PaginationInfo) + @await Html.PartialAsync("_pagination", Model.PaginationInfo)
@foreach (var catalogItem in Model.CatalogItems) {
- @Html.Partial("_product", catalogItem) + @await Html.PartialAsync("_product", catalogItem)
}
- @Html.Partial("_pagination", Model.PaginationInfo) + @await Html.PartialAsync("_pagination", Model.PaginationInfo) } else { diff --git a/src/Web/WebMVC/Views/Order/Create.cshtml b/src/Web/WebMVC/Views/Order/Create.cshtml index d9b06c67f..1c7c0fadb 100644 --- a/src/Web/WebMVC/Views/Order/Create.cshtml +++ b/src/Web/WebMVC/Views/Order/Create.cshtml @@ -6,7 +6,7 @@ ViewData["Title"] = "New Order"; } -@Html.Partial("_Header", new List
() { +@await Html.PartialAsync("_Header", new List
() { new Header() { Controller = "Cart", Text = "Back to cart" } })
diff --git a/src/Web/WebMVC/Views/Order/Detail.cshtml b/src/Web/WebMVC/Views/Order/Detail.cshtml index 5b7dadf25..d5b229443 100644 --- a/src/Web/WebMVC/Views/Order/Detail.cshtml +++ b/src/Web/WebMVC/Views/Order/Detail.cshtml @@ -7,7 +7,7 @@ }
- @Html.Partial("_Header", new List
() { + @await Html.PartialAsync("_Header", new List
() { new Header() { Controller = "Catalog", Text = "Back to catalog" } })
diff --git a/src/Web/WebMVC/Views/Order/Index.cshtml b/src/Web/WebMVC/Views/Order/Index.cshtml index 43cb389c1..3dcca1e0a 100644 --- a/src/Web/WebMVC/Views/Order/Index.cshtml +++ b/src/Web/WebMVC/Views/Order/Index.cshtml @@ -7,10 +7,10 @@ }
- @Html.Partial("_Header", new List
() { -new Header() { Controller = "Catalog", Text = "Back to catalog" }, -new Header() { Text = " / " }, -new Header() { Controller = "OrderManagement", Text = "Orders Management" } }) + @await Html.PartialAsync("_Header", new List
() { + new Header() { Controller = "Catalog", Text = "Back to catalog" }, + new Header() { Text = " / " }, + new Header() { Controller = "OrderManagement", Text = "Orders Management" } })
diff --git a/src/Web/WebMVC/Views/OrderManagement/Index.cshtml b/src/Web/WebMVC/Views/OrderManagement/Index.cshtml index acceace31..b769a0b22 100644 --- a/src/Web/WebMVC/Views/OrderManagement/Index.cshtml +++ b/src/Web/WebMVC/Views/OrderManagement/Index.cshtml @@ -7,7 +7,7 @@ }
- @Html.Partial("_Header", new List
() { + @await Html.PartialAsync("_Header", new List
() { new Header() { Controller = "Catalog", Text = "Back to catalog" } })
diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index a019498ae..0dc03e164 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -22,9 +22,9 @@ - + diff --git a/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj b/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj index 1d7ebd5a5..47a467300 100644 --- a/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj +++ b/test/ServicesTests/Application.FunctionalTests/Application.FunctionalTests.csproj @@ -67,7 +67,7 @@ - +