Ready to test
This commit is contained in:
@ -4,7 +4,7 @@ using View_by_Distance.Shared.Models.Methods;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public class DirectoryFileSystem : Models.FileSystem, Properties.IDirectoryFileSystem, IDirectoryFileSystem
|
||||
public class DirectoryFileSystem : FileSystem, Properties.IDirectoryFileSystem, IDirectoryFileSystem
|
||||
{
|
||||
|
||||
// protected new string _ClassName;
|
||||
|
@ -9,25 +9,25 @@ public class Face : Properties.IFace, IFace
|
||||
|
||||
protected double? _Α;
|
||||
protected DateTime _DateTime;
|
||||
protected Models.FaceEncoding _FaceEncoding;
|
||||
protected Dictionary<string, Models.FacePoint[]> _FaceLandmarks;
|
||||
protected Models.OutputResolution _OutputResolution;
|
||||
protected Models.Location _Location;
|
||||
protected FaceEncoding _FaceEncoding;
|
||||
protected Dictionary<string, FacePoint[]> _FaceLandmarks;
|
||||
protected OutputResolution _OutputResolution;
|
||||
protected Location _Location;
|
||||
protected int? _LocationIndex;
|
||||
protected bool _Populated;
|
||||
protected string _RelativePath;
|
||||
public double? α => _Α;
|
||||
public DateTime DateTime => _DateTime;
|
||||
public Models.FaceEncoding FaceEncoding => _FaceEncoding;
|
||||
public Dictionary<string, Models.FacePoint[]> FaceLandmarks => _FaceLandmarks;
|
||||
public Models.OutputResolution OutputResolution => _OutputResolution;
|
||||
public Models.Location Location => _Location;
|
||||
public FaceEncoding FaceEncoding => _FaceEncoding;
|
||||
public Dictionary<string, FacePoint[]> FaceLandmarks => _FaceLandmarks;
|
||||
public OutputResolution OutputResolution => _OutputResolution;
|
||||
public Location Location => _Location;
|
||||
public int? LocationIndex => _LocationIndex;
|
||||
public bool Populated => _Populated;
|
||||
public string RelativePath => _RelativePath;
|
||||
|
||||
[JsonConstructor]
|
||||
public Face(double? α, DateTime dateTime, View_by_Distance.Shared.Models.FaceEncoding faceEncoding, Dictionary<string, View_by_Distance.Shared.Models.FacePoint[]> faceLandmarks, Models.OutputResolution outputResolution, View_by_Distance.Shared.Models.Location location, int? locationIndex, bool populated, string relativePath)
|
||||
public Face(double? α, DateTime dateTime, FaceEncoding faceEncoding, Dictionary<string, FacePoint[]> faceLandmarks, OutputResolution outputResolution, Location location, int? locationIndex, bool populated, string relativePath)
|
||||
{
|
||||
_Α = α;
|
||||
_DateTime = dateTime;
|
||||
|
@ -4,7 +4,7 @@ using View_by_Distance.Shared.Models.Methods;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public class FaceFileSystem : Models.FileSystem, Properties.IFaceFileSystem, IFaceFileSystem
|
||||
public class FaceFileSystem : FileSystem, Properties.IFaceFileSystem, IFaceFileSystem
|
||||
{
|
||||
|
||||
// protected new string _ClassName;
|
||||
|
@ -10,17 +10,17 @@ public class Navigate : Properties.INavigate
|
||||
protected string _SourceDirectory;
|
||||
protected string _DirectoryRelativePath;
|
||||
protected string _EncodedSourceDirectory;
|
||||
protected Models.FaceFileSystem[] _FaceFileSystemCollection;
|
||||
protected Models.DirectoryFileSystem[] _DirectoryFileSystemCollection;
|
||||
protected FaceFileSystem[] _FaceFileSystemCollection;
|
||||
protected DirectoryFileSystem[] _DirectoryFileSystemCollection;
|
||||
public List<string[]> Levels => _Levels;
|
||||
public string SourceDirectory => _SourceDirectory;
|
||||
public string DirectoryRelativePath => _DirectoryRelativePath;
|
||||
public string EncodedSourceDirectory => _EncodedSourceDirectory;
|
||||
public Models.FaceFileSystem[] FaceFileSystemCollection => _FaceFileSystemCollection;
|
||||
public Models.DirectoryFileSystem[] DirectoryFileSystemCollection => _DirectoryFileSystemCollection;
|
||||
public FaceFileSystem[] FaceFileSystemCollection => _FaceFileSystemCollection;
|
||||
public DirectoryFileSystem[] DirectoryFileSystemCollection => _DirectoryFileSystemCollection;
|
||||
|
||||
[JsonConstructor]
|
||||
public Navigate(List<string[]> levels, string sourceDirectory, string directoryRelativePath, string encodedSourceDirectory, Models.FaceFileSystem[] faceFileSystemCollection, Models.DirectoryFileSystem[] directoryFileSystemCollection)
|
||||
public Navigate(List<string[]> levels, string sourceDirectory, string directoryRelativePath, string encodedSourceDirectory, FaceFileSystem[] faceFileSystemCollection, DirectoryFileSystem[] directoryFileSystemCollection)
|
||||
{
|
||||
_Levels = levels;
|
||||
_SourceDirectory = sourceDirectory;
|
||||
|
@ -7,11 +7,11 @@ public interface IFace
|
||||
public double? α { get; }
|
||||
#pragma warning restore IDE1006
|
||||
public DateTime DateTime { get; }
|
||||
public Models.FaceEncoding FaceEncoding { get; }
|
||||
public Dictionary<string, Models.FacePoint[]> FaceLandmarks { get; }
|
||||
public Models.Location Location { get; }
|
||||
public FaceEncoding FaceEncoding { get; }
|
||||
public Dictionary<string, FacePoint[]> FaceLandmarks { get; }
|
||||
public Location Location { get; }
|
||||
public int? LocationIndex { get; }
|
||||
public Models.OutputResolution OutputResolution { get; }
|
||||
public OutputResolution OutputResolution { get; }
|
||||
public bool Populated { get; }
|
||||
public string RelativePath { get; }
|
||||
|
||||
|
@ -6,7 +6,7 @@ public interface INavigate
|
||||
public List<string[]> Levels { get; }
|
||||
public string SourceDirectory { get; }
|
||||
public string DirectoryRelativePath { get; }
|
||||
public Models.FaceFileSystem[] FaceFileSystemCollection { get; }
|
||||
public Models.DirectoryFileSystem[] DirectoryFileSystemCollection { get; }
|
||||
public FaceFileSystem[] FaceFileSystemCollection { get; }
|
||||
public DirectoryFileSystem[] DirectoryFileSystemCollection { get; }
|
||||
|
||||
}
|
@ -27,7 +27,7 @@ internal abstract class FaceFileSystem
|
||||
{
|
||||
string json = File.ReadAllText(dataFullFileName);
|
||||
if (!json.Contains("MesaFab"))
|
||||
throw new Exception($"Maybe file <{Path.GetFileNameWithoutExtension(fullFileName)}> was moved to <{files[0]}> (unkown)!");
|
||||
throw new Exception($"Maybe file <{Path.GetFileNameWithoutExtension(fullFileName)}> was moved to <{files[0]}> (unknown)!");
|
||||
else
|
||||
{
|
||||
json = json.Replace("MesaFab", "Mesa Fab");
|
||||
@ -51,7 +51,7 @@ internal abstract class FaceFileSystem
|
||||
string? directoryName;
|
||||
string fileNameWithoutExtension;
|
||||
Models.FaceFileSystem faceFileSystem;
|
||||
string eDistanceCollectionfileFullName;
|
||||
string eDistanceCollectionFileFullName;
|
||||
Models.Face[] face = Face.GetFaces(selectedFileFullName);
|
||||
string extension = Path.GetExtension(selectedFileFullName);
|
||||
for (int i = 0; i < face.Length; i++)
|
||||
@ -68,12 +68,12 @@ internal abstract class FaceFileSystem
|
||||
continue;
|
||||
fileNameWithoutExtension = Path.GetFileNameWithoutExtension(face[i].RelativePath);
|
||||
jsonFileName = string.Concat(locationIndex.Value, " - ", fileNameWithoutExtension, extension);
|
||||
eDistanceCollectionfileFullName = string.Concat(tuple.E_DistanceCollectionDirectory, Path.Combine(directoryName, fileNameWithoutExtension, jsonFileName));
|
||||
if (i == 0 && extension is ".json" && eDistanceCollectionfileFullName != selectedFileFullName)
|
||||
eDistanceCollectionFileFullName = string.Concat(tuple.E_DistanceCollectionDirectory, Path.Combine(directoryName, fileNameWithoutExtension, jsonFileName));
|
||||
if (i == 0 && extension is ".json" && eDistanceCollectionFileFullName != selectedFileFullName)
|
||||
throw new Exception();
|
||||
fileInfo = new(eDistanceCollectionfileFullName);
|
||||
fileInfo = new(eDistanceCollectionFileFullName);
|
||||
if (!fileInfo.Exists)
|
||||
throw new Exception($"File <{eDistanceCollectionfileFullName}> doesn't exist!");
|
||||
throw new Exception($"File <{eDistanceCollectionFileFullName}> doesn't exist!");
|
||||
faceFileSystem = new Models.FaceFileSystem(requestPath, tuple.RootResultsDirectoryAbsoluteUri.Length, tuple.C_ResizeContentDirectory, tuple.D_FacesContentDirectory, fileInfo.FullName, face[i]);
|
||||
results.Add(faceFileSystem);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ internal abstract class FileSystem
|
||||
if (!subDirectoryFiles.MoveNext())
|
||||
{
|
||||
directoryInfo = new(directories[i]);
|
||||
fileSystem = new Models.DirectoryFileSystem(directoryInfo);
|
||||
fileSystem = new DirectoryFileSystem(directoryInfo);
|
||||
results.Add(fileSystem);
|
||||
}
|
||||
else
|
||||
|
@ -8,16 +8,16 @@ public interface IPerson
|
||||
Dictionary<DateTime, string[]> TestStatic_Split(string knownPeopleFile);
|
||||
static Dictionary<DateTime, string[]> Split(string knownPeopleFile) => Person.Split(knownPeopleFile);
|
||||
|
||||
Models.Person[] TestStatic_GetPeople(Models.Properties.IStorage storage);
|
||||
static Models.Person[] GetPeople(Models.Properties.IStorage storage) => Person.GetPeople(storage);
|
||||
Models.Person[] TestStatic_GetPeople(Properties.IStorage storage);
|
||||
static Models.Person[] GetPeople(Properties.IStorage storage) => Person.GetPeople(storage);
|
||||
|
||||
void TestStatic_SavePerson(Models.Properties.IStorage storage, Models.Person person);
|
||||
static void SavePerson(Models.Properties.IStorage storage, Models.Person person) => Person.SavePerson(storage, person);
|
||||
void TestStatic_SavePerson(Properties.IStorage storage, Models.Person person);
|
||||
static void SavePerson(Properties.IStorage storage, Models.Person person) => Person.SavePerson(storage, person);
|
||||
|
||||
string TestStatic_GetFileFullName(Models.Properties.IStorage storage, Models.Person person);
|
||||
static string GetFileFullName(Models.Properties.IStorage storage, Models.Person person) => PersonBirthday.GetFileFullName(storage, person.Birthday);
|
||||
string TestStatic_GetFileFullName(Properties.IStorage storage, Models.Person person);
|
||||
static string GetFileFullName(Properties.IStorage storage, Models.Person person) => PersonBirthday.GetFileFullName(storage, person.Birthday);
|
||||
|
||||
Models.Person TestStatic_CreatePerson(Models.Properties.IStorage storage, Models.PersonBirthday birthday, Models.PersonName name, List<Models.PersonComment> comments, List<Models.PersonURL> urls, List<Models.PersonNumber> numbers, List<Models.PersonEmail> emails, List<Models.PersonAddress> addresses);
|
||||
static Models.Person CreatePerson(Models.Properties.IStorage storage, Models.PersonBirthday birthday, Models.PersonName name, List<Models.PersonComment> comments, List<Models.PersonURL> urls, List<Models.PersonNumber> numbers, List<Models.PersonEmail> emails, List<Models.PersonAddress> addresses) => Person.CreatePerson(storage, birthday, name, comments, urls, numbers, emails, addresses);
|
||||
Models.Person TestStatic_CreatePerson(Properties.IStorage storage, Models.PersonBirthday birthday, Models.PersonName name, List<Models.PersonComment> comments, List<Models.PersonURL> urls, List<Models.PersonNumber> numbers, List<Models.PersonEmail> emails, List<Models.PersonAddress> addresses);
|
||||
static Models.Person CreatePerson(Properties.IStorage storage, Models.PersonBirthday birthday, Models.PersonName name, List<Models.PersonComment> comments, List<Models.PersonURL> urls, List<Models.PersonNumber> numbers, List<Models.PersonEmail> emails, List<Models.PersonAddress> addresses) => Person.CreatePerson(storage, birthday, name, comments, urls, numbers, emails, addresses);
|
||||
|
||||
}
|
@ -12,19 +12,19 @@ public interface IPersonBirthday
|
||||
string TestStatic_GetFormat() => PersonBirthday.GetFormat();
|
||||
static string GetFormat() => PersonBirthday.GetFormat();
|
||||
|
||||
Models.PersonBirthday TestStatic_GetNextBirthdate(Models.Properties.IStorage storage) => PersonBirthday.GetNextBirthdate(storage);
|
||||
static Models.PersonBirthday GetNextBirthdate(Models.Properties.IStorage storage) => PersonBirthday.GetNextBirthdate(storage);
|
||||
Models.PersonBirthday TestStatic_GetNextBirthDate(Properties.IStorage storage) => PersonBirthday.GetNextBirthDate(storage);
|
||||
static Models.PersonBirthday GetNextBirthDate(Properties.IStorage storage) => PersonBirthday.GetNextBirthDate(storage);
|
||||
|
||||
string TestStatic_GetFormated(Models.PersonBirthday personBirthday) => PersonBirthday.GetFormated(personBirthday);
|
||||
static string GetFormated(Models.PersonBirthday personBirthday) => PersonBirthday.GetFormated(personBirthday);
|
||||
string TestStatic_GetFormatted(Models.PersonBirthday personBirthday) => PersonBirthday.GetFormatted(personBirthday);
|
||||
static string GetFormatted(Models.PersonBirthday personBirthday) => PersonBirthday.GetFormatted(personBirthday);
|
||||
|
||||
string TestStatic_GetFileName(Models.PersonBirthday personBirthday) => PersonBirthday.GetFileName(personBirthday);
|
||||
static string GetFileName(Models.PersonBirthday personBirthday) => PersonBirthday.GetFileName(personBirthday);
|
||||
|
||||
bool TestStatic_DoesBirthDateExits(Models.Properties.IStorage storage, Models.PersonBirthday personBirthday) => DoesBirthDateExits(storage, personBirthday);
|
||||
static bool DoesBirthDateExits(Models.Properties.IStorage storage, Models.PersonBirthday personBirthday) => DoesBirthDateExits(storage, personBirthday);
|
||||
bool TestStatic_DoesBirthDateExits(Properties.IStorage storage, Models.PersonBirthday personBirthday) => DoesBirthDateExits(storage, personBirthday);
|
||||
static bool DoesBirthDateExits(Properties.IStorage storage, Models.PersonBirthday personBirthday) => DoesBirthDateExits(storage, personBirthday);
|
||||
|
||||
string TestStatic_GetFileFullName(Models.Properties.IStorage storage, Models.PersonBirthday personBirthday) => PersonBirthday.GetFileFullName(storage, personBirthday);
|
||||
static string GetFileFullName(Models.Properties.IStorage storage, Models.PersonBirthday personBirthday) => PersonBirthday.GetFileFullName(storage, personBirthday);
|
||||
string TestStatic_GetFileFullName(Properties.IStorage storage, Models.PersonBirthday personBirthday) => PersonBirthday.GetFileFullName(storage, personBirthday);
|
||||
static string GetFileFullName(Properties.IStorage storage, Models.PersonBirthday personBirthday) => PersonBirthday.GetFileFullName(storage, personBirthday);
|
||||
|
||||
}
|
@ -5,4 +5,7 @@ public interface IPersonName
|
||||
|
||||
// ...
|
||||
|
||||
string TestStatic_GetFullName(Models.PersonName personName);
|
||||
static string GetFullName(Models.PersonName personName) => PersonName.GetFullName(personName);
|
||||
|
||||
}
|
@ -8,7 +8,7 @@ public interface IStorage
|
||||
bool TestStatic_WriteAllText(string path, string contents, bool compareBeforeWrite);
|
||||
static bool WriteAllText(string path, string contents, bool compareBeforeWrite) => Storage.WriteAllText(path, contents, compareBeforeWrite);
|
||||
|
||||
(string RootResultsDirectoryAbsoluteUri, string C_ResizeContentDirectory, string D_FacesContentDirectory, string E_DistanceCollectionDirectory) TestStatic_GetTuple(Models.Properties.IStorage storage);
|
||||
static (string RootResultsDirectoryAbsoluteUri, string C_ResizeContentDirectory, string D_FacesContentDirectory, string E_DistanceCollectionDirectory) GetTuple(Models.Properties.IStorage storage) => new(new Uri(storage.RootResultsDirectory).AbsoluteUri, Path.Combine(storage.ResizeRootDirectory, "()"), Path.Combine(storage.FaceRootDirectory, "()"), Path.Combine(storage.DistanceResultRootDirectory, "[]"));
|
||||
(string RootResultsDirectoryAbsoluteUri, string C_ResizeContentDirectory, string D_FacesContentDirectory, string E_DistanceCollectionDirectory) TestStatic_GetTuple(Properties.IStorage storage);
|
||||
static (string RootResultsDirectoryAbsoluteUri, string C_ResizeContentDirectory, string D_FacesContentDirectory, string E_DistanceCollectionDirectory) GetTuple(Properties.IStorage storage) => new(new Uri(storage.RootResultsDirectory).AbsoluteUri, Path.Combine(storage.ResizeRootDirectory, "()"), Path.Combine(storage.FaceRootDirectory, "()"), Path.Combine(storage.DistanceResultRootDirectory, "[]"));
|
||||
|
||||
}
|
@ -7,7 +7,7 @@ internal abstract class Person
|
||||
|
||||
// ...
|
||||
|
||||
private static List<string> ValidatePerson(Models.Properties.IStorage storage, Models.PersonId id, Models.PersonBirthday birthday, Models.PersonName name)
|
||||
private static List<string> ValidatePerson(Properties.IStorage storage, Models.PersonId id, Models.PersonBirthday birthday, Models.PersonName name)
|
||||
{
|
||||
List<string> results = new();
|
||||
if (birthday is null)
|
||||
@ -21,16 +21,16 @@ internal abstract class Person
|
||||
if (name.First is null || string.IsNullOrEmpty(name.First.Value))
|
||||
results.Add("Fist Name must be supplied!");
|
||||
if (PersonBirthday.DoesBirthDateExits(storage, birthday))
|
||||
results.Add("Birthdate already exits!");
|
||||
results.Add("BirthDate already exits!");
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static Models.Person CreatePerson(Models.Properties.IStorage storage, Models.PersonBirthday birthday, Models.PersonName name, List<Models.PersonComment> comments, List<Models.PersonURL> urls, List<Models.PersonNumber> numbers, List<Models.PersonEmail> emails, List<Models.PersonAddress> addresses)
|
||||
internal static Models.Person CreatePerson(Properties.IStorage storage, Models.PersonBirthday birthday, Models.PersonName name, List<Models.PersonComment> comments, List<Models.PersonURL> urls, List<Models.PersonNumber> numbers, List<Models.PersonEmail> emails, List<Models.PersonAddress> addresses)
|
||||
{
|
||||
Models.Person result;
|
||||
Models.PersonId id = new(birthday.Value.Ticks);
|
||||
if (birthday.Value == DateTime.MinValue)
|
||||
birthday = PersonBirthday.GetNextBirthdate(storage);
|
||||
birthday = PersonBirthday.GetNextBirthDate(storage);
|
||||
List<string> results = ValidatePerson(storage, id, birthday, name);
|
||||
if (results.Any())
|
||||
throw new Exception(string.Join(Environment.NewLine, results));
|
||||
@ -126,14 +126,14 @@ internal abstract class Person
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static void SavePerson(Models.Properties.IStorage storage, Models.Person person)
|
||||
internal static void SavePerson(Properties.IStorage storage, Models.Person person)
|
||||
{
|
||||
string fileName = IPerson.GetFileFullName(storage, person);
|
||||
string json = JsonSerializer.Serialize(person, new JsonSerializerOptions { WriteIndented = true });
|
||||
_ = IStorage.WriteAllText(fileName, json, compareBeforeWrite: true);
|
||||
}
|
||||
|
||||
private static List<Models.Person> GetPeopleFromText(Models.Properties.IStorage storage, string localKnownPeopleFile)
|
||||
private static List<Models.Person> GetPeopleFromText(Properties.IStorage storage, string localKnownPeopleFile)
|
||||
{
|
||||
List<Models.Person> results = new();
|
||||
string comment;
|
||||
@ -175,7 +175,7 @@ internal abstract class Person
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static Models.Person[] GetPeople(Models.Properties.IStorage storage)
|
||||
internal static Models.Person[] GetPeople(Properties.IStorage storage)
|
||||
{
|
||||
List<Models.Person> results = new();
|
||||
string json;
|
||||
@ -187,11 +187,14 @@ internal abstract class Person
|
||||
string directory = Path.Combine(storage.PeopleRootDirectory, "{}");
|
||||
if (!Directory.Exists(directory))
|
||||
_ = Directory.CreateDirectory(directory);
|
||||
if (!Directory.Exists(storage.RootDirectory))
|
||||
string? rootDirectoryParent = Path.GetDirectoryName(storage.RootDirectory);
|
||||
if (string.IsNullOrEmpty(rootDirectoryParent))
|
||||
throw new Exception($"{nameof(rootDirectoryParent)} is null!");
|
||||
if (!Directory.Exists(rootDirectoryParent))
|
||||
localKnownPeopleFile = string.Empty;
|
||||
else
|
||||
{
|
||||
files = Directory.GetFiles(storage.RootDirectory, "*People*.txt", SearchOption.TopDirectoryOnly);
|
||||
files = Directory.GetFiles(rootDirectoryParent, "*People*.txt", SearchOption.TopDirectoryOnly);
|
||||
if (files.Any())
|
||||
localKnownPeopleFile = files[0];
|
||||
else
|
||||
|
@ -8,9 +8,10 @@ internal abstract class PersonBirthday
|
||||
// ...
|
||||
|
||||
internal static string GetFormat() => "yyyy-MM-dd_HH";
|
||||
internal static Models.PersonBirthday GetNextBirthdate(Models.Properties.IStorage storage) => throw new Exception(storage.ToString()); // Person.GetNextBirthdate(storage);
|
||||
internal static string GetFormated(Models.PersonBirthday personBirthday) => personBirthday.Value.ToString(GetFormat());
|
||||
internal static Models.PersonBirthday GetNextBirthDate(Properties.IStorage storage) => throw new Exception(storage.ToString()); // Person.GetNextBirthDate(storage);
|
||||
internal static string GetFormatted(Models.PersonBirthday personBirthday) => personBirthday.Value.ToString(GetFormat());
|
||||
internal static string GetFileName(Models.PersonBirthday personBirthday) => $"{personBirthday.Value.ToString(GetFormat())}.json";
|
||||
internal static bool DoesBirthDateExits(Models.Properties.IStorage storage, Models.PersonBirthday personBirthday) => File.Exists(GetFileFullName(storage, personBirthday));
|
||||
internal static string GetFileFullName(Models.Properties.IStorage storage, Models.PersonBirthday personBirthday) => Path.Combine(storage.PeopleRootDirectory, "{}", GetFileName(personBirthday));
|
||||
internal static bool DoesBirthDateExits(Properties.IStorage storage, Models.PersonBirthday personBirthday) => File.Exists(GetFileFullName(storage, personBirthday));
|
||||
internal static string GetFileFullName(Properties.IStorage storage, Models.PersonBirthday personBirthday) => Path.Combine(storage.PeopleRootDirectory, "{}", GetFileName(personBirthday));
|
||||
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
using System.Text;
|
||||
|
||||
namespace View_by_Distance.Shared.Models.Stateless.Methods;
|
||||
|
||||
internal abstract class PersonName
|
||||
@ -57,4 +59,16 @@ internal abstract class PersonName
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetFullName(Models.PersonName personName)
|
||||
{
|
||||
StringBuilder result = new();
|
||||
if (personName.First is not null)
|
||||
_ = result.Append(personName.First.Value);
|
||||
if (personName.Middle is not null)
|
||||
_ = result.Append(' ').Append(personName.Middle.Value);
|
||||
if (personName.Last is not null)
|
||||
_ = result.Append(' ').Append(personName.Last.Value);
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user