Adding Razor Pages Version (#60)
* In progress copying code into new RP project Cleaning up namespaces and whitespace in original Web project * Cleaning up some more namespaces * Removing unused page. * Index page loads correctly. * Fixing up paging. * Moving views; getting ready to convert to RPs * Auto stash before merge of "master" and "origin/master" Basket and Checkout pages wired up * WIP on Account pages * Working on signin/signout * Working on auth * Getting order history working Fixing auth bug * Fixing Checkout issue * Fixing link
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace Web
|
||||
namespace Microsoft.eShopWeb
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
|
||||
@@ -5,9 +5,9 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Infrastructure.Identity;
|
||||
using System;
|
||||
using ApplicationCore.Interfaces;
|
||||
using Web;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.eShopWeb.Interfaces;
|
||||
|
||||
namespace Microsoft.eShopWeb.Controllers
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace Microsoft.eShopWeb.Controllers
|
||||
|
||||
ViewData["ReturnUrl"] = returnUrl;
|
||||
if (!String.IsNullOrEmpty(returnUrl) &&
|
||||
returnUrl.ToLower().Contains("checkout"))
|
||||
returnUrl.IndexOf("checkout", StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
ViewData["ReturnUrl"] = "/Basket/Index";
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ using Microsoft.eShopWeb.ViewModels;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Infrastructure.Identity;
|
||||
using System;
|
||||
using Web;
|
||||
using System.Collections.Generic;
|
||||
using ApplicationCore.Entities.OrderAggregate;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.eShopWeb.Interfaces;
|
||||
|
||||
namespace Microsoft.eShopWeb.Controllers
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ApplicationCore.Interfaces
|
||||
namespace Microsoft.eShopWeb.Interfaces
|
||||
{
|
||||
public interface IBasketService
|
||||
{
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
using ApplicationCore.Interfaces;
|
||||
using System.Threading.Tasks;
|
||||
using ApplicationCore.Specifications;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
using System.Linq;
|
||||
using Microsoft.eShopWeb.Interfaces;
|
||||
using Microsoft.eShopWeb.ViewModels;
|
||||
using System.Collections.Generic;
|
||||
using ApplicationCore.Specifications;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Web.Services
|
||||
namespace Microsoft.eShopWeb.Services
|
||||
{
|
||||
public class BasketService : IBasketService
|
||||
{
|
||||
|
||||
@@ -32,13 +32,13 @@ namespace Microsoft.eShopWeb.Services
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<CatalogIndexViewModel> GetCatalogItems(int pageIndex, int itemsPage, int? brandID, int? typeId)
|
||||
public async Task<CatalogIndexViewModel> GetCatalogItems(int pageIndex, int itemsPage, int? brandId, int? typeId)
|
||||
{
|
||||
string cacheKey = String.Format(_itemsKeyTemplate, pageIndex, itemsPage, brandID, typeId);
|
||||
string cacheKey = String.Format(_itemsKeyTemplate, pageIndex, itemsPage, brandId, typeId);
|
||||
return await _cache.GetOrCreateAsync(cacheKey, async entry =>
|
||||
{
|
||||
entry.SlidingExpiration = _defaultCacheDuration;
|
||||
return await _catalogService.GetCatalogItems(pageIndex, itemsPage, brandID, typeId);
|
||||
return await _catalogService.GetCatalogItems(pageIndex, itemsPage, brandId, typeId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using ApplicationCore.Entities.OrderAggregate;
|
||||
using ApplicationCore.Interfaces;
|
||||
using ApplicationCore.Interfaces;
|
||||
using ApplicationCore.Services;
|
||||
using Infrastructure.Data;
|
||||
using Infrastructure.Identity;
|
||||
@@ -10,13 +9,12 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.eShopWeb.Interfaces;
|
||||
using Microsoft.eShopWeb.Services;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Text;
|
||||
using Web.Services;
|
||||
|
||||
namespace Microsoft.eShopWeb
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using ApplicationCore.Interfaces;
|
||||
using Infrastructure.Identity;
|
||||
using Infrastructure.Identity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.eShopWeb;
|
||||
using Microsoft.eShopWeb.Interfaces;
|
||||
using Microsoft.eShopWeb.ViewModels;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
{
|
||||
|
||||
public class BasketItemViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
{
|
||||
|
||||
public class BasketViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
{
|
||||
|
||||
public class CatalogItemViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
{
|
||||
|
||||
public class LoginViewModel
|
||||
{
|
||||
[Required]
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
{
|
||||
|
||||
public class OrderItemViewModel
|
||||
{
|
||||
public int ProductId { get; set; }
|
||||
@@ -19,5 +18,4 @@ namespace Microsoft.eShopWeb.ViewModels
|
||||
|
||||
public string PictureUrl { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.eShopWeb.ViewModels
|
||||
{
|
||||
|
||||
public class OrderViewModel
|
||||
{
|
||||
public int OrderNumber { get; set; }
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</section>
|
||||
|
||||
<section class="col-sm-6">
|
||||
<div class="esh-app-footer-text hidden-xs"> e-ShopOnWeb. All right reserved </div>
|
||||
<div class="esh-app-footer-text hidden-xs"> e-ShopOnWeb. All rights reserved </div>
|
||||
</section>
|
||||
|
||||
</article>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"CatalogConnection": "Server=(localdb)\\ProjectsV13;Integrated Security=true;Initial Catalog=Microsoft.eShopOnWeb.CatalogDb;",
|
||||
"IdentityConnection": "Server=(localdb)\\ProjectsV13;Integrated Security=true;Initial Catalog=Microsoft.eShopOnWeb.Identity;"
|
||||
"CatalogConnection": "Server=(localdb)\\v11.0;Integrated Security=true;Initial Catalog=Microsoft.eShopOnWeb.CatalogDb;",
|
||||
"IdentityConnection": "Server=(localdb)\\v11.0;Integrated Security=true;Initial Catalog=Microsoft.eShopOnWeb.Identity;"
|
||||
},
|
||||
"CatalogBaseUrl": "",
|
||||
"Logging": {
|
||||
|
||||
Reference in New Issue
Block a user