Fix : "// FAUT FIX POUR QUAND Y'A PAS DE REVIEWS"
continuous-integration/drone/push Build is passing Details

Popup_qui_marche_pas
Jade VAN BRABANDT 2 years ago
parent e50b8cda36
commit 4b7a90ffc5

@ -92,7 +92,12 @@ namespace Model
[DataMember]
public List<Review> Reviews { get; private init; }
public double Average => Math.Round((double)Reviews.Select(review=>review.Rate).Average(), 1); // FAUT FIX POUR QUAND Y'A PAS DE REVIEWS
public double Average => AverageCalc();
public double AverageCalc()
{
if (Reviews.Count > 0) return Math.Round((double)Reviews.Select(review => review.Rate).Average(), 1); // FAUT FIX POUR QUAND Y'A PAS DE REVIEWS
else return 0;
}
[DataMember]
public string? Lien {

@ -2,8 +2,6 @@ using Model;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Application = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Application;
using CommunityToolkit.Maui.Views;
//using Windows.Gaming.Preview.GamesEnumeration;
namespace Stim;
public partial class AddGamePage : ContentPage

Loading…
Cancel
Save