Family Tree as Markdown Files

This commit is contained in:
2023-07-16 23:06:08 -07:00
parent 240c1ef6f9
commit b2fe53275f
15 changed files with 594 additions and 202 deletions

View File

@ -62,12 +62,19 @@ internal abstract class PersonName
internal static string GetFullName(Models.PersonName personName)
{
StringBuilder result = new();
if (personName.First is not null)
if (personName.First is not null && !string.IsNullOrEmpty(personName.First.Value))
_ = result.Append(personName.First.Value);
if (personName.Middle is not null)
if (personName.Middle is not null && !string.IsNullOrEmpty(personName.Middle.Value))
_ = result.Append(' ').Append(personName.Middle.Value);
if (personName.Last is not null)
if (personName.Last is not null && !string.IsNullOrEmpty(personName.Last.Value))
_ = result.Append(' ').Append(personName.Last.Value);
if (personName.Alias is not null && !string.IsNullOrEmpty(personName.Alias.Value))
{
if (personName.Alias.Value.Contains(" Jr"))
_ = result.Append(" Jr");
else if (personName.Alias.Value.Contains(" Sr"))
_ = result.Append(" Sr");
}
return result.ToString();
}