From e7381df2f38a470e5b6aed8a10ce72658a90a5ce Mon Sep 17 00:00:00 2001 From: Jade_VAN_BRABANDT Date: Wed, 31 May 2023 16:42:06 +0200 Subject: [PATCH] =?UTF-8?q?Feat=20:=20les=20nullables=20cr=C3=A9ations=20d?= =?UTF-8?q?u=20diable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Stim.Model/Game.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Stim.Model/Game.cs b/Sources/Stim.Model/Game.cs index b54b1dc..2190ccd 100644 --- a/Sources/Stim.Model/Game.cs +++ b/Sources/Stim.Model/Game.cs @@ -9,16 +9,16 @@ namespace Model public class Game : INotifyPropertyChanged, IEquatable { [DataMember] - public string? Name + public string Name { get => name; private set { - if (string.IsNullOrWhiteSpace(value)) return; + if (string.IsNullOrWhiteSpace(value)) name="Default"; name = value; } } - private string? name; + private string name; [DataMember] public string? Description @@ -45,16 +45,16 @@ namespace Model private int year; [DataMember] - public string? Cover + public string Cover { get => cover; private set { - if (string.IsNullOrWhiteSpace(value)) return; + if (string.IsNullOrWhiteSpace(value)) cover="no_cover.png"; cover = value; } } - private string? cover; + private string cover; [DataMember] public ObservableCollection Tags @@ -94,7 +94,7 @@ namespace Model Year = year; if (c_tags is not null) tags = new ObservableCollection(c_tags); else tags = new ObservableCollection(); - if (string.IsNullOrWhiteSpace(cover)) Cover = "Default"; + if (string.IsNullOrWhiteSpace(cover)) Cover = "no_cover.png"; else Cover = cover; if (string.IsNullOrWhiteSpace(c_lien)) Lien = "Default"; else Lien = c_lien;