Remove Person Require People File,
PersonContainer and bug fix for GetRightPadded
This commit is contained in:
41
Shared/Models/PersonContainer.cs
Normal file
41
Shared/Models/PersonContainer.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public class PersonContainer : Properties.IPersonContainer
|
||||
{
|
||||
|
||||
public int? ApproximateYears { init; get; }
|
||||
public Person? Person { init; get; }
|
||||
public PersonBirthday[]? PersonBirthdays { init; get; }
|
||||
public string[] PersonDisplayDirectoryAllFiles { init; get; }
|
||||
public string PersonDisplayDirectoryName { init; get; }
|
||||
public long? PersonKey { init; get; }
|
||||
|
||||
[JsonConstructor]
|
||||
public PersonContainer(int? approximateYears, Person? person, PersonBirthday[]? personBirthdays, string[] personDisplayDirectoryAllFiles, string personDisplayDirectoryName, long? personKey)
|
||||
{
|
||||
ApproximateYears = approximateYears;
|
||||
Person = person;
|
||||
PersonBirthdays = personBirthdays;
|
||||
PersonDisplayDirectoryAllFiles = personDisplayDirectoryAllFiles;
|
||||
PersonDisplayDirectoryName = personDisplayDirectoryName;
|
||||
PersonKey = personKey;
|
||||
}
|
||||
|
||||
public PersonContainer(int? approximateYears, string[] personDisplayDirectoryAllFiles, string personDisplayDirectoryName) :
|
||||
this(approximateYears, null, null, personDisplayDirectoryAllFiles, personDisplayDirectoryName, null)
|
||||
{ }
|
||||
|
||||
public PersonContainer(int? approximateYears, PersonBirthday personBirthday, string personDisplayDirectoryName, long personKey) :
|
||||
this(approximateYears, null, new PersonBirthday[] { personBirthday }, Array.Empty<string>(), personDisplayDirectoryName, personKey)
|
||||
{ }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user