From 17cd3bf43890b62aa8a98fe72d5632937a705df3 Mon Sep 17 00:00:00 2001 From: stasex Date: Thu, 9 Nov 2023 13:18:23 +0200 Subject: [PATCH] add new field in product model --- ShoppingAssistantWebClient.Web/Models/Product.cs | 2 ++ ShoppingAssistantWebClient.Web/Pages/Cart.razor.cs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ShoppingAssistantWebClient.Web/Models/Product.cs b/ShoppingAssistantWebClient.Web/Models/Product.cs index bff5020..210c462 100644 --- a/ShoppingAssistantWebClient.Web/Models/Product.cs +++ b/ShoppingAssistantWebClient.Web/Models/Product.cs @@ -12,6 +12,8 @@ public class Product public required double Rating {get; set;} + public required double Price { get; set; } + public required string[] ImagesUrls {get; set;} public required bool WasOpened {get; set;} diff --git a/ShoppingAssistantWebClient.Web/Pages/Cart.razor.cs b/ShoppingAssistantWebClient.Web/Pages/Cart.razor.cs index 51d2c19..be8d88a 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Cart.razor.cs +++ b/ShoppingAssistantWebClient.Web/Pages/Cart.razor.cs @@ -7,9 +7,9 @@ public partial class Cart : ComponentBase { public List Products = new() { - new Product {Id = "0", Url = "some link", Name = "HDMI", Description = "super mega hdmi cabel", Rating = 3.8, ImagesUrls = new string[] {"link"}, WasOpened = false, WishlistId = "0"}, - new Product {Id = "1", Url = "some link", Name = "HDMI", Description = "super mega hdmi cabel", Rating = 3.8, ImagesUrls = new string[] {"link"}, WasOpened = false, WishlistId = "1"}, - new Product {Id = "2", Url = "some link", Name = "HDMI", Description = "super mega hdmi cabel", Rating = 3.8, ImagesUrls = new string[] {"link"}, WasOpened = false, WishlistId = "2"} + new Product {Id = "0", Url = "some link", Name = "HDMI", Description = "super mega hdmi cabel", Rating = 3.8, Price = 300, ImagesUrls = new string[] {"link"}, WasOpened = false, WishlistId = "0"}, + new Product {Id = "1", Url = "some link", Name = "HDMI", Description = "super mega hdmi cabel", Rating = 3.8, Price = 111, ImagesUrls = new string[] {"link"}, WasOpened = false, WishlistId = "1"}, + new Product {Id = "2", Url = "some link", Name = "HDMI", Description = "super mega hdmi cabel", Rating = 3.8, Price = 50, ImagesUrls = new string[] {"link"}, WasOpened = false, WishlistId = "2"} }; protected override async Task OnInitializedAsync()