Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BO Netzlokation: Make NetzlokationsId and Sparte nullable #494

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Merge branch 'main' into netzlokation
hf-kklein authored Nov 25, 2024
commit 75b1fb22a35512b0d417848f129f43322fa7f1d4
4 changes: 2 additions & 2 deletions BO4E/BO/Netzlokation.cs
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ public class Netzlokation : BusinessObject
/// verbraucht, oder erzeugt wird (Like MarktlokationsId <see cref="Marktlokation"/>)
/// </summary>
[DefaultValue("|null|")]
[JsonProperty(Required = Required.Default, Order = 10, PropertyName = "netzlokationsId")]
[JsonProperty(Order = 10, PropertyName = "netzlokationsId")]
[JsonPropertyName("netzlokationsId")]
[JsonPropertyOrder(10)]
[DataCategory(DataCategory.POD)]
@@ -29,7 +29,7 @@ public class Netzlokation : BusinessObject
public string? NetzlokationsId { get; set; }

/// <summary>Sparte der Netzlokation, z.B. Gas oder Strom.</summary>
[JsonProperty(Required = Required.Default, Order = 11, PropertyName = "sparte")]
[JsonProperty(Order = 11, PropertyName = "sparte")]
[JsonPropertyOrder(11)]
[JsonPropertyName("sparte")]
[ProtoMember(5)]

Unchanged files with check annotations Beta

private readonly JsonSerializerOptions _options = new()
{
Converters = { new JsonStringEnumConverter() },
IgnoreNullValues = true,

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

GitHub Actions / unittest (9)

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

GitHub Actions / unittest (8.0.401)

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

GitHub Actions / pushfeature

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

GitHub Actions / pushfeature

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)
};
[TestMethod]
// BusinessObjects
typeof(Auftrag),
typeof(AuftragsStorno),

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / unittest (9)

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / unittest (8.0.401)

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'
typeof(Avis),
typeof(Benachrichtigung),
typeof(Berechnungsformel),
typeof(PreisblattUmlagen),
typeof(Region),
typeof(Sperrauftrag),
typeof(SperrauftragsStorno),

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / unittest (9)

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / unittest (8.0.401)

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'
// COMponents
typeof(Abweichung),
typeof(AufAbschlag),
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedVerwendungszweck?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 455 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 455 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedVerwendungszweck.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 494 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 494 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedVerwendungszweck?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 523 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 523 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedVerwendungszweck.ToString());
You are viewing a condensed version of this merge commit. You can view the full changes here.