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:
Steve Smith
2017-10-23 09:23:57 -04:00
committed by GitHub
parent 0eb4d72b89
commit dea73a5f5e
155 changed files with 29464 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
namespace Web
namespace Microsoft.eShopWeb
{
public static class Constants
{

View File

@@ -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";
}

View File

@@ -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
{

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace ApplicationCore.Interfaces
namespace Microsoft.eShopWeb.Interfaces
{
public interface IBasketService
{

View File

@@ -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
{

View File

@@ -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);
});
}

View File

@@ -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
{

View File

@@ -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;

View File

@@ -1,6 +1,5 @@
namespace Microsoft.eShopWeb.ViewModels
{
public class BasketItemViewModel
{
public int Id { get; set; }

View File

@@ -4,7 +4,6 @@ using System.Linq;
namespace Microsoft.eShopWeb.ViewModels
{
public class BasketViewModel
{
public int Id { get; set; }

View File

@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.eShopWeb.ApplicationCore.Entities;
using System.Collections.Generic;
namespace Microsoft.eShopWeb.ViewModels

View File

@@ -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; }

View File

@@ -2,7 +2,6 @@
namespace Microsoft.eShopWeb.ViewModels
{
public class LoginViewModel
{
[Required]

View File

@@ -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; }
}
}

View File

@@ -4,7 +4,6 @@ using System.Collections.Generic;
namespace Microsoft.eShopWeb.ViewModels
{
public class OrderViewModel
{
public int OrderNumber { get; set; }

View File

@@ -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>

View File

@@ -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": {