People
log pattern
This commit is contained in:
23
Models/Birth.cs
Normal file
23
Models/Birth.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace File_Folder_Helper.Models;
|
||||
|
||||
public record Birth(DateOnly? Date,
|
||||
string? Note,
|
||||
List<string> Continue)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, BirthSourceGenerationContext.Default.Birth);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(Birth))]
|
||||
internal partial class BirthSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
23
Models/Change.cs
Normal file
23
Models/Change.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace File_Folder_Helper.Models;
|
||||
|
||||
public record Change(DateOnly? Date,
|
||||
string? Note,
|
||||
List<string> Continue)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, ChangeSourceGenerationContext.Default.Change);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(Change))]
|
||||
internal partial class ChangeSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
24
Models/Death.cs
Normal file
24
Models/Death.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace File_Folder_Helper.Models;
|
||||
|
||||
public record Death(bool? Is,
|
||||
DateOnly? Date,
|
||||
string? Note,
|
||||
List<string> Continue)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, DeathSourceGenerationContext.Default.Death);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(Death))]
|
||||
internal partial class DeathSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
25
Models/Name.cs
Normal file
25
Models/Name.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace File_Folder_Helper.Models;
|
||||
|
||||
public record Name(string? ForwardSlashFull,
|
||||
string? Given,
|
||||
string? Sur,
|
||||
string? Nick,
|
||||
string? Suffix)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, NameSourceGenerationContext.Default.Name);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(Name))]
|
||||
internal partial class NameSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
34
Models/Person.cs
Normal file
34
Models/Person.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace File_Folder_Helper.Models;
|
||||
|
||||
public record Person(long Id,
|
||||
Name? Name,
|
||||
char? Sex,
|
||||
string? UId,
|
||||
Birth? Birth,
|
||||
Death? Death,
|
||||
Change? Change,
|
||||
string[] Lines)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, PersonSourceGenerationContext.Default.Person);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(Person))]
|
||||
internal partial class PersonSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(Dictionary<long, Person>))]
|
||||
internal partial class PeopleSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user