diff --git a/Person/Person.cs b/Person/Person.cs index e74c974..774a627 100644 --- a/Person/Person.cs +++ b/Person/Person.cs @@ -155,44 +155,48 @@ public class Person log.Information("Enter persons birthday month (press enter if not known) [MMMM || MMM || MM || M]"); line = System.Console.ReadLine(); log.Information(". . ."); - if (!string.IsNullOrEmpty(line)) + if (string.IsNullOrEmpty(line)) + { + log.Information("Enter persons approximate age"); + line = System.Console.ReadLine(); + log.Information(". . ."); + if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _)) + continue; + approximateYears = line; + } + else + { month = line; - else - { - log.Information("Enter persons approximate age"); + log.Information("Enter persons birthday day (press enter if not known)"); line = System.Console.ReadLine(); log.Information(". . ."); - if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _)) - continue; - approximateYears = line; - } - log.Information("Enter persons birthday day (press enter if not known)"); - line = System.Console.ReadLine(); - log.Information(". . ."); - if (!string.IsNullOrEmpty(line)) - day = line; - else - { - log.Information("Enter persons approximate age"); - line = System.Console.ReadLine(); - log.Information(". . ."); - if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _)) - continue; - approximateYears = line; - } - log.Information("Enter persons birthday year (press enter if not known)"); - line = System.Console.ReadLine(); - log.Information(". . ."); - if (!string.IsNullOrEmpty(line)) - year = line; - else - { - log.Information("Enter persons approximate age"); - line = System.Console.ReadLine(); - log.Information(". . ."); - if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _)) - continue; - approximateYears = line; + if (string.IsNullOrEmpty(line)) + { + log.Information("Enter persons approximate age"); + line = System.Console.ReadLine(); + log.Information(". . ."); + if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _)) + continue; + approximateYears = line; + } + else + { + day = line; + log.Information("Enter persons birthday year (press enter if not known)"); + line = System.Console.ReadLine(); + log.Information(". . ."); + if (!string.IsNullOrEmpty(line)) + year = line; + else + { + log.Information("Enter persons approximate age"); + line = System.Console.ReadLine(); + log.Information(". . ."); + if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _)) + continue; + approximateYears = line; + } + } } if (month is null || day is null || year is null) dateTime = null; diff --git a/Person/appsettings.json b/Person/appsettings.json index 2fabfc1..6900418 100644 --- a/Person/appsettings.json +++ b/Person/appsettings.json @@ -77,7 +77,7 @@ "Microsoft.Hosting.Lifetime": "Information" } }, - "MaxDegreeOfParallelism": 6, + "MaxDegreeOfParallelism": 1, "Serilog": { "Using": [ "Serilog.Sinks.Console",