deterministicHashCode
This commit is contained in:
28
Shared/Models/FilePath.cs
Normal file
28
Shared/Models/FilePath.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record FilePath(string DirectoryName,
|
||||
string ExtensionLowered,
|
||||
string FullName,
|
||||
int? Id,
|
||||
bool IsIdFormat,
|
||||
bool IsPaddedIdFormat,
|
||||
string Name,
|
||||
string NameWithoutExtension)
|
||||
{
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, FilePathSourceGenerationContext.Default.FilePath);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(FilePath))]
|
||||
public partial class FilePathSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user