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 b/ShoppingAssistantWebClient.Web/Pages/Cart.razor index 24d11b3..ae8f3e9 100644 --- a/ShoppingAssistantWebClient.Web/Pages/Cart.razor +++ b/ShoppingAssistantWebClient.Web/Pages/Cart.razor @@ -10,7 +10,7 @@ @{ - string price = "N/A"; + string price = @product.Price.ToString(); } 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()