├── BlazorEcommerce ├── Client │ ├── Pages │ │ ├── Admin │ │ │ ├── Products.razor.css │ │ │ ├── ProductTypes.razor.css │ │ │ ├── Categories.razor.css │ │ │ ├── EditProduct.razor.css │ │ │ ├── ProductTypes.razor │ │ │ ├── Products.razor │ │ │ └── Categories.razor │ │ ├── Counter.razor │ │ ├── OrderSuccess.razor │ │ ├── OrderDetails.razor.css │ │ ├── Orders.razor.css │ │ ├── ProductDetails.razor.css │ │ ├── Cart.razor.css │ │ ├── Index.razor │ │ ├── Orders.razor │ │ ├── FetchData.razor │ │ ├── OrderDetails.razor │ │ ├── Profile.razor │ │ ├── Register.razor │ │ ├── Login.razor │ │ ├── Cart.razor │ │ └── ProductDetails.razor │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── icon-192.png │ │ ├── css │ │ │ ├── open-iconic │ │ │ │ ├── font │ │ │ │ │ └── fonts │ │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ │ └── open-iconic.woff │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── FONT-LICENSE │ │ │ └── app.css │ │ └── index.html │ ├── Shared │ │ ├── HomeButton.razor.css │ │ ├── AdminMenu.razor.css │ │ ├── UserButton.razor.css │ │ ├── HomeButton.razor │ │ ├── MainLayout.razor │ │ ├── ShopLayout.razor │ │ ├── SurveyPrompt.razor │ │ ├── ProductList.razor.css │ │ ├── CartCounter.razor │ │ ├── FeaturedProducts.razor.css │ │ ├── AdminMenu.razor │ │ ├── NavMenu.razor.css │ │ ├── ShopNavMenu.razor.css │ │ ├── NavMenu.razor │ │ ├── ShopNavMenu.razor │ │ ├── ShopLayout.razor.css │ │ ├── Search.razor │ │ ├── FeaturedProducts.razor │ │ ├── MainLayout.razor.css │ │ ├── UserButton.razor │ │ ├── ProductList.razor │ │ └── AddressForm.razor │ ├── Services │ │ ├── AddressService │ │ │ ├── IAddressService.cs │ │ │ └── AddressService.cs │ │ ├── OrderService │ │ │ ├── IOrderService.cs │ │ │ └── OrderService.cs │ │ ├── AuthService │ │ │ ├── IAuthService.cs │ │ │ └── AuthService.cs │ │ ├── ProductTypeService │ │ │ ├── IProductTypeService.cs │ │ │ └── ProductTypeService.cs │ │ ├── CartService │ │ │ ├── ICartService.cs │ │ │ └── CartService.cs │ │ ├── CategoryService │ │ │ ├── ICategoryService.cs │ │ │ └── CategoryService.cs │ │ └── ProductService │ │ │ ├── IProductService.cs │ │ │ └── ProductService.cs │ ├── App.razor │ ├── BlazorEcommerce.Client.csproj │ ├── _Imports.razor │ ├── Properties │ │ └── launchSettings.json │ ├── Program.cs │ └── CustomAuthStateProvider.cs ├── Server │ ├── appsettings.Development.json │ ├── Services │ │ ├── AddressService │ │ │ ├── IAddressService.cs │ │ │ └── AddressService.cs │ │ ├── PaymentService │ │ │ ├── IPaymentService.cs │ │ │ └── PaymentService.cs │ │ ├── OrderService │ │ │ ├── IOrderService.cs │ │ │ └── OrderService.cs │ │ ├── ProductTypeService │ │ │ ├── IProductTypeService.cs │ │ │ └── ProductTypeService.cs │ │ ├── CategoryService │ │ │ ├── ICategoryService.cs │ │ │ └── CategoryService.cs │ │ ├── AuthService │ │ │ ├── IAuthService.cs │ │ │ └── AuthService.cs │ │ ├── CartService │ │ │ ├── ICartService.cs │ │ │ └── CartService.cs │ │ └── ProductService │ │ │ └── IProductService.cs │ ├── appsettings.json │ ├── Migrations │ │ ├── 20211205210009_UserRole.cs │ │ ├── 20211124204804_CartItems.cs │ │ ├── 20211112205817_CreateInitial.cs │ │ ├── 20211117210144_Users.cs │ │ ├── 20211116221155_FeaturedProducts.cs │ │ ├── 20220429135440_Images.cs │ │ ├── 20211205212215_CategoryFlags.cs │ │ ├── 20211112205817_CreateInitial.Designer.cs │ │ ├── 20211204205151_UserAddress.cs │ │ ├── 20211129201337_Orders.cs │ │ ├── 20211112210614_ProductSeeding.cs │ │ ├── 20211114114952_Categories.cs │ │ ├── 20211112210614_ProductSeeding.Designer.cs │ │ └── 20211114115758_SeedMoreProducts.cs │ ├── Pages │ │ ├── Error.cshtml.cs │ │ └── Error.cshtml │ ├── Controllers │ │ ├── AddressController.cs │ │ ├── OrderController.cs │ │ ├── WeatherForecastController.cs │ │ ├── PaymentController.cs │ │ ├── ProductTypeController.cs │ │ ├── CategoryController.cs │ │ ├── AuthController.cs │ │ ├── CartController.cs │ │ └── ProductController.cs │ ├── Properties │ │ └── launchSettings.json │ ├── BlazorEcommerce.Server.csproj │ └── Program.cs └── Shared │ ├── Image.cs │ ├── BlazorEcommerce.Shared.csproj │ ├── WeatherForecast.cs │ ├── ServiceResponse.cs │ ├── ProductSearchResult.cs │ ├── CartItem.cs │ ├── OrderDetailsResponse.cs │ ├── UserLogin.cs │ ├── OrderOverviewResponse.cs │ ├── ProductType.cs │ ├── OrderDetailsProductResponse.cs │ ├── UserChangePassword.cs │ ├── Order.cs │ ├── User.cs │ ├── CartProductResponse.cs │ ├── UserRegister.cs │ ├── Category.cs │ ├── OrderItem.cs │ ├── Address.cs │ ├── ProductVariant.cs │ └── Product.cs ├── BlazorEcommerce.sln └── .gitattributes /BlazorEcommerce/Client/Pages/Admin/Products.razor.css: -------------------------------------------------------------------------------- 1 | img { 2 | max-height: 100px; 3 | max-width: 100px; 4 | } 5 | -------------------------------------------------------------------------------- /BlazorEcommerce/Client/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickgod/BlazorEcommerce/HEAD/BlazorEcommerce/Client/wwwroot/favicon.ico -------------------------------------------------------------------------------- /BlazorEcommerce/Client/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickgod/BlazorEcommerce/HEAD/BlazorEcommerce/Client/wwwroot/icon-192.png -------------------------------------------------------------------------------- /BlazorEcommerce/Client/Pages/Admin/ProductTypes.razor.css: -------------------------------------------------------------------------------- 1 | .row { 2 | display: flex; 3 | padding: 6px; 4 | } 5 | 6 | .col { 7 | flex: 1; 8 | } 9 | -------------------------------------------------------------------------------- /BlazorEcommerce/Client/Shared/HomeButton.razor.css: -------------------------------------------------------------------------------- 1 | .home-button { 2 | white-space: nowrap; 3 | margin-right: 10px; 4 | transform: rotate(-5deg); 5 | } 6 | -------------------------------------------------------------------------------- /BlazorEcommerce/Client/Shared/AdminMenu.razor.css: -------------------------------------------------------------------------------- 1 | .top-row a { 2 | margin-left: 0 !important; 3 | } 4 | 5 | .dropdown-item:hover { 6 | background-color: white; 7 | } 8 | -------------------------------------------------------------------------------- /BlazorEcommerce/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickgod/BlazorEcommerce/HEAD/BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickgod/BlazorEcommerce/HEAD/BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickgod/BlazorEcommerce/HEAD/BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickgod/BlazorEcommerce/HEAD/BlazorEcommerce/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /BlazorEcommerce/Client/Shared/UserButton.razor.css: -------------------------------------------------------------------------------- 1 | .show-menu { 2 | display: block; 3 | } 4 | 5 | .user-button { 6 | margin-left: .5em; 7 | } 8 | 9 | .top-row a { 10 | margin-left: 0; 11 | } 12 | 13 | .dropdown-item:hover { 14 | background-color: white; 15 | } 16 | -------------------------------------------------------------------------------- /BlazorEcommerce/Client/Services/AddressService/IAddressService.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorEcommerce.Client.Services.AddressService 2 | { 3 | public interface IAddressService 4 | { 5 | Task
GetAddress(); 6 | Task AddOrUpdateAddress(Address address); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /BlazorEcommerce/Server/Services/AddressService/IAddressService.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorEcommerce.Server.Services.AddressService 2 | { 3 | public interface IAddressService 4 | { 5 | TaskCurrent count: @currentCount
8 | 9 | 10 | 11 | @code { 12 | private int currentCount = 0; 13 | 14 | private void IncrementCount() 15 | { 16 | currentCount++; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /BlazorEcommerce/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "server=localhost\\sqlexpress;database=blazorecommerce;trusted_connection=true" 4 | }, 5 | "AppSettings": { 6 | "Token": "my top secret key" 7 | }, 8 | "Logging": { 9 | "LogLevel": { 10 | "Default": "Information", 11 | "Microsoft.AspNetCore": "Warning" 12 | } 13 | }, 14 | "AllowedHosts": "*" 15 | } 16 | -------------------------------------------------------------------------------- /BlazorEcommerce/Client/Pages/OrderSuccess.razor: -------------------------------------------------------------------------------- 1 | @page "/order-success" 2 | @inject ICartService CartService 3 | 4 |Sorry, there's nothing at this address.
16 |This component demonstrates fetching data from the server.
10 | 11 | @if (forecasts == null) 12 | { 13 |Loading...
14 | } 15 | else 16 | { 17 || Date | 21 |Temp. (C) | 22 |Temp. (F) | 23 |Summary | 24 |
|---|---|---|---|
| @forecast.Date.ToShortDateString() | 31 |@forecast.TemperatureC | 32 |@forecast.TemperatureF | 33 |@forecast.Summary | 34 |
24 | Request ID: @Model.RequestId
25 |
30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |
32 |33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |
38 || 21 | | Product | 22 |Variant | 23 |Price | 24 |Visible | 25 |26 | |
|---|---|---|---|---|---|
|
32 | @if (!string.IsNullOrEmpty(product.ImageUrl))
33 | {
34 | |
41 | @product.Title | 42 |
43 | @foreach (var variant in product.Variants)
44 | {
45 | @variant.ProductType.Name
46 |
47 | 48 | } 49 | |
50 |
51 | @foreach (var variant in product.Variants)
52 | {
53 | @variant.Price
54 |
55 | 56 | } 57 | |
58 | @(product.Visible ? "✔️" : "") | 59 |60 | 63 | | 64 |
13 | @address.FirstName @address.LastName
14 | @address.Street
15 | @address.City, @address.State, @address.Zip
16 | @address.Country
17 |
@product.Description
29 | @if (product.Variants != null && product.Variants.Count > 1) 30 | { 31 |