forked from dotnet-architecture/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Razor Pages Version (dotnet-architecture#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
- Loading branch information
Showing
155 changed files
with
29,464 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Web | ||
namespace Microsoft.eShopWeb | ||
{ | ||
public static class Constants | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
namespace Microsoft.eShopWeb.ViewModels | ||
{ | ||
|
||
public class BasketItemViewModel | ||
{ | ||
public int Id { get; set; } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
namespace Microsoft.eShopWeb.ViewModels | ||
{ | ||
|
||
public class BasketViewModel | ||
{ | ||
public int Id { get; set; } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
namespace Microsoft.eShopWeb.ViewModels | ||
{ | ||
|
||
public class LoginViewModel | ||
{ | ||
[Required] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "wwwroot/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Microsoft.eShopWeb.RazorPages | ||
{ | ||
public static class Constants | ||
{ | ||
public const string BASKET_COOKIENAME = "eShop"; | ||
public const int ITEMS_PER_PAGE = 10; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Microsoft.eShopWeb.RazorPages.ViewModels; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.eShopWeb.RazorPages.Interfaces | ||
{ | ||
public interface IBasketService | ||
{ | ||
Task<BasketViewModel> GetOrCreateBasketForUser(string userName); | ||
Task TransferBasketAsync(string anonymousId, string userName); | ||
Task AddItemToBasket(int basketId, int catalogItemId, decimal price, int quantity); | ||
Task SetQuantities(int basketId, Dictionary<string, int> quantities); | ||
Task DeleteBasketAsync(int basketId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Microsoft.AspNetCore.Mvc.Rendering; | ||
using Microsoft.eShopWeb.RazorPages.ViewModels; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.eShopWeb.RazorPages.Interfaces | ||
{ | ||
public interface ICatalogService | ||
{ | ||
Task<CatalogIndexViewModel> GetCatalogItems(int pageIndex, int itemsPage, int? brandId, int? typeId); | ||
Task<IEnumerable<SelectListItem>> GetBrands(); | ||
Task<IEnumerable<SelectListItem>> GetTypes(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@page | ||
@model RegisterModel | ||
@{ | ||
ViewData["Title"] = "Register"; | ||
} | ||
<div class="brand-header-block"> | ||
<ul class="container"> | ||
<li class="active" style="margin-right: 65px;">Already have an account? | ||
<a asp-page="/Account/Signin">LOGIN</a></li> | ||
</ul> | ||
</div> | ||
<div class="container account-login-container"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<section> | ||
<form asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal"> | ||
<div asp-validation-summary="All" class="text-danger"></div> | ||
<div class="form-group"> | ||
<label asp-for="UserDetails.Email" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="UserDetails.Email" class="form-control" /> | ||
<span asp-validation-for="UserDetails.Email" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label asp-for="UserDetails.Password" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="UserDetails.Password" class="form-control" /> | ||
<span asp-validation-for="UserDetails.Password" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label asp-for="UserDetails.ConfirmPassword" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="UserDetails.ConfirmPassword" class="form-control" /> | ||
<span asp-validation-for="UserDetails.ConfirmPassword" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<button type="submit" class="btn btn-default btn-brand btn-brand-big"> REGISTER </button> | ||
</div> | ||
<p> | ||
Note that for demo purposes you don't need to register! Use the credentials shown below the | ||
<a asp-action="signin">login screen</a>. | ||
</p> | ||
</form> | ||
</section> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
@section Scripts { | ||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } | ||
} |
Oops, something went wrong.