Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Substance" /> class.
 /// </summary>
 /// <param name="Id">Id (required).</param>
 /// <param name="PrimaryName">PrimaryName (required).</param>
 /// <param name="RegulatoryBurden">RegulatoryBurden.</param>
 /// <param name="Identifiers">Identifiers.</param>
 /// <param name="Names">Names.</param>
 /// <param name="RelatedSubstances">RelatedSubstances.</param>
 /// <param name="Links">Links.</param>
 public Substance(int?Id = null, string PrimaryName = null, float?RegulatoryBurden = null, Identifiers Identifiers = null, SubstanceNames Names = null, RelatedSubstances RelatedSubstances = null, Links Links = null)
 {
     // to ensure "Id" is required (not null)
     if (Id == null)
     {
         throw new InvalidDataException("Id is a required property for Substance and cannot be null");
     }
     else
     {
         this.Id = Id;
     }
     // to ensure "PrimaryName" is required (not null)
     if (PrimaryName == null)
     {
         throw new InvalidDataException("PrimaryName is a required property for Substance and cannot be null");
     }
     else
     {
         this.PrimaryName = PrimaryName;
     }
     this.RegulatoryBurden  = RegulatoryBurden;
     this.Identifiers       = Identifiers;
     this.Names             = Names;
     this.RelatedSubstances = RelatedSubstances;
     this.Links             = Links;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Entry" /> class.
 /// </summary>
 /// <param name="Id">Id (required).</param>
 /// <param name="SubstanceId">SubstanceId (required).</param>
 /// <param name="RegulatoryListId">RegulatoryListId (required).</param>
 /// <param name="ReleaseId">ReleaseId (required).</param>
 /// <param name="Identifiers">Identifiers.</param>
 /// <param name="Names">Names (required).</param>
 /// <param name="ChemicalData">ChemicalData.</param>
 /// <param name="Links">Links.</param>
 public Entry(string Id = null, int?SubstanceId = null, int?RegulatoryListId = null, int?ReleaseId = null, Identifiers Identifiers = null, SubstanceNames Names = null, EntryChemicalData ChemicalData = null, Links Links = null)
 {
     // to ensure "Id" is required (not null)
     if (Id == null)
     {
         throw new InvalidDataException("Id is a required property for Entry and cannot be null");
     }
     else
     {
         this.Id = Id;
     }
     // to ensure "SubstanceId" is required (not null)
     if (SubstanceId == null)
     {
         throw new InvalidDataException("SubstanceId is a required property for Entry and cannot be null");
     }
     else
     {
         this.SubstanceId = SubstanceId;
     }
     // to ensure "RegulatoryListId" is required (not null)
     if (RegulatoryListId == null)
     {
         throw new InvalidDataException("RegulatoryListId is a required property for Entry and cannot be null");
     }
     else
     {
         this.RegulatoryListId = RegulatoryListId;
     }
     // to ensure "ReleaseId" is required (not null)
     if (ReleaseId == null)
     {
         throw new InvalidDataException("ReleaseId is a required property for Entry and cannot be null");
     }
     else
     {
         this.ReleaseId = ReleaseId;
     }
     // to ensure "Names" is required (not null)
     if (Names == null)
     {
         throw new InvalidDataException("Names is a required property for Entry and cannot be null");
     }
     else
     {
         this.Names = Names;
     }
     this.Identifiers  = Identifiers;
     this.ChemicalData = ChemicalData;
     this.Links        = Links;
 }