From e2650f2a45c98bac4d435d8dcb1f032000e6a053 Mon Sep 17 00:00:00 2001 From: Arnaud Declercq Date: Thu, 12 Dec 2024 13:39:11 +0000 Subject: [PATCH] Add default value to core properties --- XML_oM/Bluebeam/BluebeamObject.cs | 8 ++++---- XML_oM/CSProject/CSProjectObject.cs | 10 +++++----- XML_oM/EnergyPlus/EnergyPlusObject.cs | 11 ++++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/XML_oM/Bluebeam/BluebeamObject.cs b/XML_oM/Bluebeam/BluebeamObject.cs index ffbcf2e..0b4f1ab 100644 --- a/XML_oM/Bluebeam/BluebeamObject.cs +++ b/XML_oM/Bluebeam/BluebeamObject.cs @@ -36,13 +36,13 @@ public class BluebeamObject : IBHoMObject [XmlIgnore] public virtual Guid BHoM_Guid { get; set; } = Guid.NewGuid(); [XmlIgnore] - public virtual Dictionary CustomData { get; set; } + public virtual Dictionary CustomData { get; set; } = new Dictionary(); [XmlIgnore] - public virtual string Name { get; set; } + public virtual string Name { get; set; } = ""; [XmlIgnore] - public virtual FragmentSet Fragments { get; set; } + public virtual FragmentSet Fragments { get; set; } = new FragmentSet(); [XmlIgnore] - public virtual HashSet Tags { get; set; } + public virtual HashSet Tags { get; set; } = new HashSet(); } } diff --git a/XML_oM/CSProject/CSProjectObject.cs b/XML_oM/CSProject/CSProjectObject.cs index 05cb228..75004bd 100644 --- a/XML_oM/CSProject/CSProjectObject.cs +++ b/XML_oM/CSProject/CSProjectObject.cs @@ -34,15 +34,15 @@ namespace BH.oM.XML.CSProject public class CSProjectObject : IBHoMObject { [XmlIgnore] - public virtual Guid BHoM_Guid { get; set; } + public virtual Guid BHoM_Guid { get; set; } = Guid.NewGuid(); [XmlIgnore] - public virtual Dictionary CustomData { get; set; } + public virtual Dictionary CustomData { get; set; } = new Dictionary(); [XmlIgnore] - public virtual string Name { get; set; } + public virtual string Name { get; set; } = ""; [XmlIgnore] - public virtual FragmentSet Fragments { get; set; } + public virtual FragmentSet Fragments { get; set; } = new FragmentSet(); [XmlIgnore] - public virtual HashSet Tags { get; set; } + public virtual HashSet Tags { get; set; } = new HashSet(); } } diff --git a/XML_oM/EnergyPlus/EnergyPlusObject.cs b/XML_oM/EnergyPlus/EnergyPlusObject.cs index 1cfc829..21436c9 100644 --- a/XML_oM/EnergyPlus/EnergyPlusObject.cs +++ b/XML_oM/EnergyPlus/EnergyPlusObject.cs @@ -34,15 +34,16 @@ namespace BH.oM.XML.EnergyPlus public class EnergyPlusObject : IBHoMObject { [XmlIgnore] - public virtual Guid BHoM_Guid { get; set; } + public virtual Guid BHoM_Guid { get; set; } = Guid.NewGuid(); [XmlIgnore] - public virtual Dictionary CustomData { get; set; } + public virtual Dictionary CustomData { get; set; } = new Dictionary(); [XmlIgnore] - public virtual string Name { get; set; } + public virtual string Name { get; set; } = ""; [XmlIgnore] - public virtual FragmentSet Fragments { get; set; } + public virtual FragmentSet Fragments { get; set; } = new FragmentSet(); [XmlIgnore] - public virtual HashSet Tags { get; set; } + public virtual HashSet Tags { get; set; } = new HashSet(); + } }