Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
6c9647a31d
@ -27,7 +27,7 @@ namespace FunctionalTests.Services.Catalog
|
|||||||
.AddEnvironmentVariables();
|
.AddEnvironmentVariables();
|
||||||
}).UseStartup<Startup>();
|
}).UseStartup<Startup>();
|
||||||
|
|
||||||
var testServer = new TestServer(hostBuilder);
|
var testServer = new TestServer(hostBuilder);
|
||||||
|
|
||||||
testServer.Host
|
testServer.Host
|
||||||
.MigrateDbContext<CatalogContext>((context, services) =>
|
.MigrateDbContext<CatalogContext>((context, services) =>
|
||||||
|
@ -43,8 +43,8 @@ namespace FunctionalTests.Services
|
|||||||
var oldPrice = itemToModify.UnitPrice;
|
var oldPrice = itemToModify.UnitPrice;
|
||||||
var newPrice = oldPrice + priceModification;
|
var newPrice = oldPrice + priceModification;
|
||||||
var pRes = await catalogClient.PutAsync(CatalogScenariosBase.Put.UpdateCatalogProduct, new StringContent(ChangePrice(itemToModify, newPrice, originalCatalogProducts), UTF8Encoding.UTF8, "application/json"));
|
var pRes = await catalogClient.PutAsync(CatalogScenariosBase.Put.UpdateCatalogProduct, new StringContent(ChangePrice(itemToModify, newPrice, originalCatalogProducts), UTF8Encoding.UTF8, "application/json"));
|
||||||
|
|
||||||
var modifiedCatalogProducts = await GetCatalogAsync(catalogClient);
|
var modifiedCatalogProducts = await GetCatalogAsync(catalogClient);
|
||||||
|
|
||||||
var itemUpdated = await GetUpdatedBasketItem(newPrice, itemToModify.ProductId, userId, basketClient);
|
var itemUpdated = await GetUpdatedBasketItem(newPrice, itemToModify.ProductId, userId, basketClient);
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace FunctionalTests.Services
|
|||||||
BasketItem itemUpdated = null;
|
BasketItem itemUpdated = null;
|
||||||
|
|
||||||
while (continueLoop && counter < 20)
|
while (continueLoop && counter < 20)
|
||||||
{
|
{
|
||||||
//get the basket and verify that the price of the modified product is updated
|
//get the basket and verify that the price of the modified product is updated
|
||||||
var basketGetResponse = await basketClient.GetAsync(BasketScenariosBase.Get.GetBasketByCustomer(userId));
|
var basketGetResponse = await basketClient.GetAsync(BasketScenariosBase.Get.GetBasketByCustomer(userId));
|
||||||
var basketUpdated = JsonConvert.DeserializeObject<CustomerBasket>(await basketGetResponse.Content.ReadAsStringAsync());
|
var basketUpdated = JsonConvert.DeserializeObject<CustomerBasket>(await basketGetResponse.Content.ReadAsStringAsync());
|
||||||
@ -92,7 +92,7 @@ namespace FunctionalTests.Services
|
|||||||
return itemUpdated;
|
return itemUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<PaginatedItemsViewModel<CatalogItem>> GetCatalogAsync(HttpClient catalogClient)
|
private async Task<PaginatedItemsViewModel<CatalogItem>> GetCatalogAsync(HttpClient catalogClient)
|
||||||
{
|
{
|
||||||
var response = await catalogClient.GetAsync(CatalogScenariosBase.Get.Items);
|
var response = await catalogClient.GetAsync(CatalogScenariosBase.Get.Items);
|
||||||
var items = await response.Content.ReadAsStringAsync();
|
var items = await response.Content.ReadAsStringAsync();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
public static class Post
|
public static class Post
|
||||||
{
|
{
|
||||||
public static string AddNewuserLocationRule(int campaignId)
|
public static string AddNewuserLocationRule(int campaignId)
|
||||||
=> GetUserLocationRolesUrlBase(campaignId);
|
=> GetUserLocationRolesUrlBase(campaignId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ using Xunit;
|
|||||||
namespace FunctionalTests.Services.Ordering
|
namespace FunctionalTests.Services.Ordering
|
||||||
{
|
{
|
||||||
public class OrderingScenarios : OrderingScenariosBase
|
public class OrderingScenarios : OrderingScenariosBase
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task Cancel_basket_and_check_order_status_cancelled()
|
public async Task Cancel_basket_and_check_order_status_cancelled()
|
||||||
{
|
{
|
||||||
@ -69,7 +69,8 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
var ordersGetResponse = await orderClient.GetStringAsync(OrderingScenariosBase.Get.Orders);
|
var ordersGetResponse = await orderClient.GetStringAsync(OrderingScenariosBase.Get.Orders);
|
||||||
var orders = JsonConvert.DeserializeObject<List<Order>>(ordersGetResponse);
|
var orders = JsonConvert.DeserializeObject<List<Order>>(ordersGetResponse);
|
||||||
|
|
||||||
if (orders == null || orders.Count == 0) {
|
if (orders == null || orders.Count == 0)
|
||||||
|
{
|
||||||
counter++;
|
counter++;
|
||||||
await Task.Delay(100);
|
await Task.Delay(100);
|
||||||
continue;
|
continue;
|
||||||
@ -84,9 +85,9 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
if (IsOrderCreated(order, city))
|
if (IsOrderCreated(order, city))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return order;
|
return order;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +118,7 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
var order = new OrderDTO()
|
var order = new OrderDTO()
|
||||||
{
|
{
|
||||||
OrderNumber = orderId
|
OrderNumber = orderId
|
||||||
};
|
};
|
||||||
return JsonConvert.SerializeObject(order);
|
return JsonConvert.SerializeObject(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
CardExpiration = DateTime.Now.AddYears(1),
|
CardExpiration = DateTime.Now.AddYears(1),
|
||||||
CardSecurityNumber = "123",
|
CardSecurityNumber = "123",
|
||||||
CardTypeId = 1,
|
CardTypeId = 1,
|
||||||
Buyer = "Buyer",
|
Buyer = "Buyer",
|
||||||
RequestId = Guid.NewGuid()
|
RequestId = Guid.NewGuid()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -143,4 +144,3 @@ namespace FunctionalTests.Services.Ordering
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.WebMVC
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC
|
|
||||||
{
|
{
|
||||||
public class AppSettings
|
public class AppSettings
|
||||||
{
|
{
|
||||||
|
@ -2,16 +2,16 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
|||||||
{
|
{
|
||||||
using AspNetCore.Authorization;
|
using AspNetCore.Authorization;
|
||||||
using AspNetCore.Mvc;
|
using AspNetCore.Mvc;
|
||||||
using global::WebMVC.Services.ModelDTOs;
|
|
||||||
using global::WebMVC.Services;
|
using global::WebMVC.Services;
|
||||||
|
using global::WebMVC.Services.ModelDTOs;
|
||||||
using global::WebMVC.ViewModels;
|
using global::WebMVC.ViewModels;
|
||||||
|
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Services;
|
using Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ViewModels;
|
using ViewModels;
|
||||||
using ViewModels.Pagination;
|
using ViewModels.Pagination;
|
||||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
|
||||||
|
|
||||||
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
|
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
|
||||||
public class CampaignsController : Controller
|
public class CampaignsController : Controller
|
||||||
@ -31,12 +31,12 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
|||||||
{
|
{
|
||||||
var campaignList = await _campaignService.GetCampaigns(pageSize, page);
|
var campaignList = await _campaignService.GetCampaigns(pageSize, page);
|
||||||
|
|
||||||
if(campaignList is null)
|
if (campaignList is null)
|
||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
var totalPages = (int) Math.Ceiling((decimal) campaignList.Count / pageSize);
|
var totalPages = (int)Math.Ceiling((decimal)campaignList.Count / pageSize);
|
||||||
|
|
||||||
var vm = new CampaignViewModel
|
var vm = new CampaignViewModel
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
using System;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination;
|
|
||||||
using Microsoft.eShopOnContainers.WebMVC.Services;
|
using Microsoft.eShopOnContainers.WebMVC.Services;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination;
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
||||||
{
|
{
|
||||||
@ -12,10 +11,10 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
|||||||
{
|
{
|
||||||
private ICatalogService _catalogSvc;
|
private ICatalogService _catalogSvc;
|
||||||
|
|
||||||
public CatalogController(ICatalogService catalogSvc) =>
|
public CatalogController(ICatalogService catalogSvc) =>
|
||||||
_catalogSvc = catalogSvc;
|
_catalogSvc = catalogSvc;
|
||||||
|
|
||||||
public async Task<IActionResult> Index(int? BrandFilterApplied, int? TypesFilterApplied, int? page, [FromQuery]string errorMsg)
|
public async Task<IActionResult> Index(int? BrandFilterApplied, int? TypesFilterApplied, int? page, [FromQuery] string errorMsg)
|
||||||
{
|
{
|
||||||
var itemsPage = 10;
|
var itemsPage = 10;
|
||||||
var catalog = await _catalogSvc.GetCatalogItems(page ?? 0, itemsPage, BrandFilterApplied, TypesFilterApplied);
|
var catalog = await _catalogSvc.GetCatalogItems(page ?? 0, itemsPage, BrandFilterApplied, TypesFilterApplied);
|
||||||
@ -30,7 +29,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
|
|||||||
{
|
{
|
||||||
ActualPage = page ?? 0,
|
ActualPage = page ?? 0,
|
||||||
ItemsPerPage = catalog.Data.Count,
|
ItemsPerPage = catalog.Data.Count,
|
||||||
TotalItems = catalog.Count,
|
TotalItems = catalog.Count,
|
||||||
TotalPages = (int)Math.Ceiling(((decimal)catalog.Count / itemsPage))
|
TotalPages = (int)Math.Ceiling(((decimal)catalog.Count / itemsPage))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
using System;
|
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||||
using System.Collections.Generic;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using WebMVC.Services.ModelDTOs;
|
|
||||||
using Microsoft.eShopOnContainers.WebMVC.Services;
|
using Microsoft.eShopOnContainers.WebMVC.Services;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
using WebMVC.Services.ModelDTOs;
|
||||||
|
|
||||||
namespace WebMVC.Controllers
|
namespace WebMVC.Controllers
|
||||||
{
|
{
|
||||||
@ -37,7 +34,7 @@ namespace WebMVC.Controllers
|
|||||||
{
|
{
|
||||||
await _orderSvc.ShipOrder(orderId);
|
await _orderSvc.ShipOrder(orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace WebMVC.Controllers
|
|||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
var str = await response.Content.ReadAsStringAsync();
|
var str = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
return Ok(str);
|
return Ok(str);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.Extensions
|
namespace Microsoft.eShopOnContainers.WebMVC.Extensions
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
|
|
||||||
public static class SessionExtensions
|
public static class SessionExtensions
|
||||||
|
@ -22,7 +22,7 @@ namespace WebMVC.Infrastructure
|
|||||||
request.Headers.Add("x-requestid", Guid.NewGuid().ToString());
|
request.Headers.Add("x-requestid", Guid.NewGuid().ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return await base.SendAsync(request, cancellationToken);
|
return await base.SendAsync(request, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Primitives;
|
using Microsoft.Extensions.Primitives;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -63,7 +62,7 @@ namespace WebMVC.Infrastructure.Middlewares
|
|||||||
new Claim("name", "Test user"),
|
new Claim("name", "Test user"),
|
||||||
new Claim("nonce", Guid.NewGuid().ToString()),
|
new Claim("nonce", Guid.NewGuid().ToString()),
|
||||||
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "Test user"),
|
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "Test user"),
|
||||||
new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"),
|
new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"),
|
||||||
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"),
|
new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"),
|
||||||
new Claim("sub", currentUserId),
|
new Claim("sub", currentUserId),
|
||||||
new Claim("card_expiration", "12/21"),
|
new Claim("card_expiration", "12/21"),
|
||||||
|
@ -35,7 +35,7 @@ namespace WebMVC.Infrastructure
|
|||||||
static void GetPreconfiguredCSS(string contentRootPath, string webroot, ILogger log)
|
static void GetPreconfiguredCSS(string contentRootPath, string webroot, ILogger log)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string overrideCssFile = Path.Combine(contentRootPath, "Setup", "override.css");
|
string overrideCssFile = Path.Combine(contentRootPath, "Setup", "override.css");
|
||||||
if (!File.Exists(overrideCssFile))
|
if (!File.Exists(overrideCssFile))
|
||||||
{
|
{
|
||||||
@ -44,7 +44,7 @@ namespace WebMVC.Infrastructure
|
|||||||
}
|
}
|
||||||
|
|
||||||
string destinationFilename = Path.Combine(webroot, "css", "override.css");
|
string destinationFilename = Path.Combine(webroot, "css", "override.css");
|
||||||
File.Copy(overrideCssFile, destinationFilename, true );
|
File.Copy(overrideCssFile, destinationFilename, true);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -86,7 +86,7 @@ namespace WebMVC.Infrastructure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch ( Exception ex )
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log.Error(ex, "EXCEPTION ERROR: {Message}", ex.Message);
|
log.Error(ex, "EXCEPTION ERROR: {Message}", ex.Message);
|
||||||
}
|
}
|
||||||
|
@ -42,13 +42,13 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
|
|
||||||
private static IWebHost BuildWebHost(IConfiguration configuration, string[] args) =>
|
private static IWebHost BuildWebHost(IConfiguration configuration, string[] args) =>
|
||||||
WebHost.CreateDefaultBuilder(args)
|
WebHost.CreateDefaultBuilder(args)
|
||||||
.CaptureStartupErrors(false)
|
.CaptureStartupErrors(false)
|
||||||
.ConfigureAppConfiguration(x => x.AddConfiguration(configuration))
|
.ConfigureAppConfiguration(x => x.AddConfiguration(configuration))
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.UseSerilog()
|
.UseSerilog()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
|
private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
var seqServerUrl = configuration["Serilog:SeqServerUrl"];
|
var seqServerUrl = configuration["Serilog:SeqServerUrl"];
|
||||||
var logstashUrl = configuration["Serilog:LogstashgUrl"];
|
var logstashUrl = configuration["Serilog:LogstashgUrl"];
|
||||||
@ -57,10 +57,12 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
.Enrich.WithProperty("ApplicationContext", AppName)
|
.Enrich.WithProperty("ApplicationContext", AppName)
|
||||||
.Enrich.FromLogContext()
|
.Enrich.FromLogContext()
|
||||||
.WriteTo.Console();
|
.WriteTo.Console();
|
||||||
if (!string.IsNullOrWhiteSpace(seqServerUrl)) {
|
if (!string.IsNullOrWhiteSpace(seqServerUrl))
|
||||||
|
{
|
||||||
cfg.WriteTo.Seq(seqServerUrl);
|
cfg.WriteTo.Seq(seqServerUrl);
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrWhiteSpace(logstashUrl)) {
|
if (!string.IsNullOrWhiteSpace(logstashUrl))
|
||||||
|
{
|
||||||
cfg.WriteTo.Http(logstashUrl);
|
cfg.WriteTo.Http(logstashUrl);
|
||||||
}
|
}
|
||||||
return cfg.CreateLogger();
|
return cfg.CreateLogger();
|
||||||
|
@ -23,7 +23,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
|
|||||||
{
|
{
|
||||||
_apiClient = httpClient;
|
_apiClient = httpClient;
|
||||||
_settings = settings;
|
_settings = settings;
|
||||||
_logger =logger;
|
_logger = logger;
|
||||||
|
|
||||||
_basketByPassUrl = $"{_settings.Value.PurchaseUrl}/b/api/v1/basket";
|
_basketByPassUrl = $"{_settings.Value.PurchaseUrl}/b/api/v1/basket";
|
||||||
_purchaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1";
|
_purchaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1";
|
||||||
@ -33,7 +33,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
|
|||||||
{
|
{
|
||||||
var uri = API.Basket.GetBasket(_basketByPassUrl, user.Id);
|
var uri = API.Basket.GetBasket(_basketByPassUrl, user.Id);
|
||||||
_logger.LogDebug("[GetBasket] -> Calling {Uri} to get the basket", uri);
|
_logger.LogDebug("[GetBasket] -> Calling {Uri} to get the basket", uri);
|
||||||
var response = await _apiClient.GetAsync(uri);
|
var response = await _apiClient.GetAsync(uri);
|
||||||
_logger.LogDebug("[GetBasket] -> response code {StatusCode}", response.StatusCode);
|
_logger.LogDebug("[GetBasket] -> response code {StatusCode}", response.StatusCode);
|
||||||
var responseString = await response.Content.ReadAsStringAsync();
|
var responseString = await response.Content.ReadAsStringAsync();
|
||||||
return string.IsNullOrEmpty(responseString) ?
|
return string.IsNullOrEmpty(responseString) ?
|
||||||
@ -97,7 +97,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
|
|||||||
|
|
||||||
var responseString = await _apiClient.GetStringAsync(uri);
|
var responseString = await _apiClient.GetStringAsync(uri);
|
||||||
|
|
||||||
var response = JsonConvert.DeserializeObject<Order>(responseString);
|
var response = JsonConvert.DeserializeObject<Order>(responseString);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using WebMVC.Services.ModelDTOs;
|
using WebMVC.Services.ModelDTOs;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
||||||
{
|
{
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ViewModels;
|
using ViewModels;
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System.Security.Principal;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Principal;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using WebMVC.Services.ModelDTOs;
|
using WebMVC.Services.ModelDTOs;
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
namespace Microsoft.eShopOnContainers.WebMVC.Services
|
||||||
{
|
{
|
||||||
public class IdentityParser:IIdentityParser<ApplicationUser>
|
public class IdentityParser : IIdentityParser<ApplicationUser>
|
||||||
{
|
{
|
||||||
public ApplicationUser Parse(IPrincipal principal)
|
public ApplicationUser Parse(IPrincipal principal)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ namespace WebMVC.Services.ModelDTOs
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public DateTime CardExpiration { get; set; }
|
public DateTime CardExpiration { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public string CardSecurityNumber { get; set; }
|
public string CardSecurityNumber { get; set; }
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ namespace WebMVC.Services.ModelDTOs
|
|||||||
public string Buyer { get; set; }
|
public string Buyer { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public Guid RequestId { get; set; }
|
public Guid RequestId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,19 +7,16 @@ using Microsoft.AspNetCore.DataProtection;
|
|||||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.eShopOnContainers.WebMVC.Services;
|
using Microsoft.eShopOnContainers.WebMVC.Services;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.IdentityModel.Logging;
|
using Microsoft.IdentityModel.Logging;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
using System;
|
using System;
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
using System.Net.Http;
|
|
||||||
using WebMVC.Infrastructure;
|
using WebMVC.Infrastructure;
|
||||||
using WebMVC.Infrastructure.Middlewares;
|
using WebMVC.Infrastructure.Middlewares;
|
||||||
using WebMVC.Services;
|
using WebMVC.Services;
|
||||||
@ -46,8 +43,8 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
.AddDevspaces()
|
.AddDevspaces()
|
||||||
.AddHttpClientServices(Configuration);
|
.AddHttpClientServices(Configuration);
|
||||||
|
|
||||||
IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII
|
IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII
|
||||||
|
|
||||||
services.AddControllers();
|
services.AddControllers();
|
||||||
|
|
||||||
services.AddCustomAuthentication(Configuration);
|
services.AddCustomAuthentication(Configuration);
|
||||||
@ -82,13 +79,13 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
}
|
}
|
||||||
|
|
||||||
WebContextSeed.Seed(app, env);
|
WebContextSeed.Seed(app, env);
|
||||||
|
|
||||||
// Fix samesite issue when running eShop from docker-compose locally as by default http protocol is being used
|
// Fix samesite issue when running eShop from docker-compose locally as by default http protocol is being used
|
||||||
// Refer to https://github.com/dotnet-architecture/eShopOnContainers/issues/1391
|
// Refer to https://github.com/dotnet-architecture/eShopOnContainers/issues/1391
|
||||||
app.UseCookiePolicy(new CookiePolicyOptions { MinimumSameSitePolicy = AspNetCore.Http.SameSiteMode.Lax });
|
app.UseCookiePolicy(new CookiePolicyOptions { MinimumSameSitePolicy = AspNetCore.Http.SameSiteMode.Lax });
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.eShopOnContainers.WebMVC.Services;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.Services;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents
|
||||||
@ -24,7 +21,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents
|
|||||||
vm.ItemsCount = itemsInCart;
|
vm.ItemsCount = itemsInCart;
|
||||||
return View(vm);
|
return View(vm);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
ViewBag.IsBasketInoperative = true;
|
ViewBag.IsBasketInoperative = true;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
|
||||||
using Microsoft.eShopOnContainers.WebMVC.Services;
|
using Microsoft.eShopOnContainers.WebMVC.Services;
|
||||||
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents
|
||||||
@ -29,7 +27,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents
|
|||||||
|
|
||||||
return View(vm);
|
return View(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task<Basket> GetItemsAsync(ApplicationUser user) => _cartSvc.GetBasket(user);
|
private Task<Basket> GetItemsAsync(ApplicationUser user) => _cartSvc.GetBasket(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Annotations
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Annotations
|
||||||
{
|
{
|
||||||
@ -24,7 +21,8 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Annotations
|
|||||||
DateTime d = new DateTime(year, month, 1);
|
DateTime d = new DateTime(year, month, 1);
|
||||||
|
|
||||||
return d > DateTime.UtcNow;
|
return d > DateTime.UtcNow;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ namespace WebMVC.ViewModels.Annotations
|
|||||||
("Longitude must be between -180 and 180 degrees inclusive.");
|
("Longitude must be between -180 and 180 degrees inclusive.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return ValidationResult.Success;
|
return ValidationResult.Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
using System;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
{
|
{
|
||||||
@ -16,7 +15,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
|||||||
|
|
||||||
public decimal Total()
|
public decimal Total()
|
||||||
{
|
{
|
||||||
return Math.Round(Items.Sum(x => x.UnitPrice * x.Quantity),2);
|
return Math.Round(Items.Sum(x => x.UnitPrice * x.Quantity), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
|
||||||
{
|
{
|
||||||
public class BasketItem
|
public class BasketItem
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
namespace WebMVC.ViewModels
|
namespace WebMVC.ViewModels
|
||||||
{
|
{
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination;
|
||||||
using WebMVC.ViewModels.Annotations;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using WebMVC.ViewModels.Annotations;
|
||||||
|
|
||||||
public class CampaignViewModel
|
public class CampaignViewModel
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels
|
|
||||||
{
|
{
|
||||||
public class CartComponentViewModel
|
public class CartComponentViewModel
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
|
||||||
{
|
{
|
||||||
public class CatalogItem
|
public class CatalogItem
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
|
||||||
{
|
{
|
||||||
public class Header
|
public class Header
|
||||||
{
|
{
|
||||||
|
@ -5,21 +5,19 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using WebMVC.Services.ModelDTOs;
|
using WebMVC.Services.ModelDTOs;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
{
|
{
|
||||||
public class Order
|
public class Order
|
||||||
{
|
{
|
||||||
public string OrderNumber {get;set;}
|
public string OrderNumber { get; set; }
|
||||||
|
|
||||||
public DateTime Date {get;set;}
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
|
|
||||||
public decimal Total {get;set;}
|
public decimal Total { get; set; }
|
||||||
|
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels
|
|
||||||
{
|
{
|
||||||
public class OrderItem
|
public class OrderItem
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination
|
|
||||||
{
|
{
|
||||||
public class PaginationInfo
|
public class PaginationInfo
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
namespace eShopOnContainers.WebSPA
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace eShopOnContainers.WebSPA
|
|
||||||
{
|
{
|
||||||
public class AppSettings
|
public class AppSettings
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using Microsoft.AspNetCore;
|
using Microsoft.AspNetCore;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using System.IO;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace eShopConContainers.WebSPA
|
namespace eShopConContainers.WebSPA
|
||||||
{
|
{
|
||||||
@ -36,6 +36,6 @@ namespace eShopConContainers.WebSPA
|
|||||||
.Enrich.FromLogContext()
|
.Enrich.FromLogContext()
|
||||||
.WriteTo.Console();
|
.WriteTo.Console();
|
||||||
})
|
})
|
||||||
.Build();
|
.Build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
|
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
|
||||||
|
|
||||||
|
using eShopOnContainers.WebSPA;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using eShopOnContainers.WebSPA;
|
|
||||||
|
|
||||||
namespace eShopConContainers.WebSPA.Server.Controllers
|
namespace eShopConContainers.WebSPA.Server.Controllers
|
||||||
{
|
{
|
||||||
@ -20,6 +20,6 @@ namespace eShopConContainers.WebSPA.Server.Controllers
|
|||||||
public IActionResult Configuration()
|
public IActionResult Configuration()
|
||||||
{
|
{
|
||||||
return Json(_settings.Value);
|
return Json(_settings.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ namespace eShopConContainers.WebSPA
|
|||||||
{
|
{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page
|
// Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page
|
||||||
// load and passed back token on every subsequent async request
|
// load and passed back token on every subsequent async request
|
||||||
// app.Use(async (context, next) =>
|
// app.Use(async (context, next) =>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
using HealthChecks.UI.Configuration;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace WebStatus.Controllers
|
namespace WebStatus.Controllers
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user