Initial Commit
Inital Commit of Code base, nothing tested.
This commit is contained in:
commit
0144221712
31 changed files with 1304 additions and 0 deletions
25
FreeTubeSync/Model/Setting.cs
Normal file
25
FreeTubeSync/Model/Setting.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace FreeTubeSync.Model;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class Setting
|
||||
{
|
||||
[Key]
|
||||
#pragma warning disable CS8618
|
||||
public string _id { get; set; } = string.Empty;
|
||||
public string? ValueJson { get; set; }
|
||||
#pragma warning restore CS8618
|
||||
|
||||
[NotMapped]
|
||||
public object Value
|
||||
{
|
||||
#pragma warning disable CS8603
|
||||
get => string.IsNullOrEmpty(ValueJson) ? null : JsonSerializer.Deserialize<object>(ValueJson);
|
||||
#pragma warning restore CS8603
|
||||
set => ValueJson = JsonSerializer.Serialize(value);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue