Merge pull request #10 from Shchoholiev/bug/SA-145-add-price-for-product

bug/SA-145-add-price-for-search
This commit is contained in:
Mykhailo Bilodid 2023-11-09 17:12:43 +02:00 committed by GitHub
commit cb141c760a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

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

View File

@ -10,7 +10,7 @@
<img class="star" src="~/assets/star.png">
<label class="rating">@product.Rating</label>
@{
string price = "N/A";
string price = @product.Price.ToString();
}
<label class="price-label">@price</label>
</div>

View File

@ -7,9 +7,9 @@ public partial class Cart : ComponentBase
{
public List<Product> 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()