diff --git a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj
index c7855f18e..eb2eacb0a 100644
--- a/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj
+++ b/src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj
@@ -10,6 +10,7 @@
+
diff --git a/src/ApiGateways/ApiGw-Base/Startup.cs b/src/ApiGateways/ApiGw-Base/Startup.cs
index f4b7eaff7..8d52851b4 100644
--- a/src/ApiGateways/ApiGw-Base/Startup.cs
+++ b/src/ApiGateways/ApiGw-Base/Startup.cs
@@ -92,6 +92,7 @@ namespace OcelotApiGw
app.UseRouting();
app.UseEndpoints(endpoints =>
{
+ endpoints.MapControllers();
endpoints.MapHealthChecks("/hc", new HealthCheckOptions()
{
Predicate = _ => true,
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketData.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketData.cs
index 1b9348c44..302f6bd32 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketData.cs
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketData.cs
@@ -1,15 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{
public class BasketData
{
public string BuyerId { get; set; }
+
public List Items { get; set; }
+ public BasketData()
+ {
+
+ }
+
public BasketData(string buyerId)
{
BuyerId = buyerId;
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/CatalogItem.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/CatalogItem.cs
index 25f766719..603c70bd7 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/CatalogItem.cs
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/CatalogItem.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
+namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{
public class CatalogItem
{
@@ -13,8 +8,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
public decimal Price { get; set; }
-
public string PictureUri { get; set; }
-
}
}
diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
index 0c690bbcc..986973f93 100644
--- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
+++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
@@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Filters.Basket.API.Infrastructure.Filters;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Infrastructure;
@@ -46,7 +45,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
.AddUrlGroup(new Uri(Configuration["PaymentUrlHC"]), name: "paymentapi-check", tags: new string[] { "paymentapi" })
.AddUrlGroup(new Uri(Configuration["LocationUrlHC"]), name: "locationapi-check", tags: new string[] { "locationapi" });
- services.AddCustomMvc(Configuration)
+ services.AddCustomRouting(Configuration)
.AddCustomAuthentication(Configuration)
.AddDevspaces()
.AddHttpServices();
@@ -77,12 +76,13 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
app.UseHsts();
}
- app.UseAuthentication();
app.UseHttpsRedirection();
app.UseRouting();
+ app.UseAuthentication();
app.UseEndpoints(endpoints =>
{
endpoints.MapDefaultControllerRoute();
+ endpoints.MapControllers();
endpoints.MapHealthChecks("/hc", new HealthCheckOptions()
{
Predicate = _ => true,
@@ -108,14 +108,11 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
public static class ServiceCollectionExtensions
{
- public static IServiceCollection AddCustomMvc(this IServiceCollection services, IConfiguration configuration)
+ public static IServiceCollection AddCustomRouting(this IServiceCollection services, IConfiguration configuration)
{
services.AddOptions();
services.Configure(configuration.GetSection("urls"));
-
- services.AddMvc()
- .SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
-
+ services.AddControllers().AddNewtonsoftJson();
services.AddSwaggerGen(options =>
{
options.DescribeAllEnumsAsStrings();
@@ -174,15 +171,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
options.Authority = identityUrl;
options.RequireHttpsMetadata = false;
options.Audience = "mobileshoppingagg";
- options.Events = new JwtBearerEvents()
- {
- OnAuthenticationFailed = async ctx =>
- {
- },
- OnTokenValidated = async ctx =>
- {
- }
- };
});
return services;
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketData.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketData.cs
index 01831a5c9..d29afb5c6 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketData.cs
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketData.cs
@@ -1,15 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{
public class BasketData
{
public string BuyerId { get; set; }
+
public List Items { get; set; }
+ public BasketData()
+ {
+
+ }
+
public BasketData(string buyerId)
{
BuyerId = buyerId;
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/CatalogItem.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/CatalogItem.cs
index c6085f934..43e8e1cd1 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/CatalogItem.cs
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Models/CatalogItem.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
+namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{
public class CatalogItem
{
@@ -13,8 +8,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
public decimal Price { get; set; }
-
public string PictureUri { get; set; }
-
}
}
diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
index 9edbf2815..0b7790e36 100644
--- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
+++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
@@ -82,6 +82,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
app.UseEndpoints(endpoints =>
{
endpoints.MapDefaultControllerRoute();
+ endpoints.MapControllers();
endpoints.MapHealthChecks("/hc", new HealthCheckOptions()
{
Predicate = _ => true,
diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs
index b250c365c..014dca9f6 100644
--- a/src/Web/WebMVC/Startup.cs
+++ b/src/Web/WebMVC/Startup.cs
@@ -81,16 +81,16 @@ namespace Microsoft.eShopOnContainers.WebMVC
app.UseMiddleware();
}
- app.UseAuthentication();
-
WebContextSeed.Seed(app, env, loggerFactory);
app.UseHttpsRedirection();
app.UseRouting();
+ app.UseAuthentication();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute("default", "{controller=Catalog}/{action=Index}/{id?}");
endpoints.MapControllerRoute("defaultError", "{controller=Error}/{action=Error}");
+ endpoints.MapControllers();
endpoints.MapHealthChecks("/liveness", new HealthCheckOptions
{
Predicate = r => r.Name.Contains("self")
diff --git a/src/_build/dependencies.props b/src/_build/dependencies.props
index b83d987cc..4de3340c6 100644
--- a/src/_build/dependencies.props
+++ b/src/_build/dependencies.props
@@ -40,6 +40,7 @@
5.2.7
15.9.20
1.0.172
+ 3.0.0-preview4-19123-01
1.0.2105168
3.0.0-preview6-19319-03
5.1.0