Skip to content

Commit

Permalink
Enhanced readability in Secondary Example
Browse files Browse the repository at this point in the history
  • Loading branch information
smartyeric authored Aug 13, 2024
1 parent b4bb824 commit 5ee1f13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/examples/USEnrichmentSecondaryExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void Run()
if (results is not null) {
foreach (SmartyStreets.USEnrichmentApi.Secondary.Result result in results) {
PrintResult(result);
if (result.Aliases != null) {
if (result.Aliases is not null) {
Console.WriteLine("Aliases: {");
foreach (SmartyStreets.USEnrichmentApi.Secondary.Aliases alias in result.Aliases) {
PrintResult(alias);
Expand Down Expand Up @@ -81,7 +81,7 @@ public static void Run()
Console.WriteLine(ex.Message + ex.StackTrace);
}

if (countResults != null) {
if (countResults is not null) {
Console.WriteLine("Count: {");
foreach (SmartyStreets.USEnrichmentApi.Secondary.Count.Result result in countResults) {
PrintResult(result);
Expand All @@ -103,7 +103,7 @@ private static void PrintResult(object obj){
PrintResult(property.GetValue(obj, null));
Console.WriteLine("}\n");
}
else if (property.GetValue(obj, null) != null && property.Name != "Aliases" && property.Name != "Secondaries") {
else if (property.GetValue(obj, null) is not null && property.Name != "Aliases" && property.Name != "Secondaries") {
Console.WriteLine($"{property.Name}: {property.GetValue(obj, null)}");
}
}
Expand Down

0 comments on commit 5ee1f13

Please sign in to comment.