Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions BO4E/BO/Messlokation.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.ComponentModel;
Expand Down Expand Up @@ -38,7 +39,7 @@ public class Messlokation : BusinessObject
[DataCategory(DataCategory.POD)]
[BoKey]
[ProtoMember(4)]
public string MesslokationsId { get; set; }
public string? MesslokationsId { get; set; }

/// <summary>
/// * Sparte der Messlokation, z.B. Gas oder Strom.
Expand Down Expand Up @@ -307,9 +308,9 @@ public static bool ValidateId(string id)
/// Test if the <see cref="MesslokationsId" /> is valid.
/// </summary>
/// <returns>if messlokationsId matches the expected format</returns>
public bool HasValidId()
public bool? HasValidId()
{
return ValidateId(MesslokationsId);
return MesslokationsId is null ? null : ValidateId(MesslokationsId);
}

/// <summary>
Expand All @@ -320,6 +321,6 @@ public bool HasValidId()
/// <returns>true if the marktlokation is valid</returns>
public bool IsValid(bool checkId = true)
{
return base.IsValid() && (!checkId || HasValidId());
return base.IsValid() && (!checkId || HasValidId()==true || HasValidId()==null);
}
}
Loading