mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-05-09 15:24:00 -04:00
14 lines
451 B
C#
14 lines
451 B
C#
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using System.Text.Json;
|
|
|
|
namespace Cleanuparr.Persistence.Converters;
|
|
|
|
public class JsonStringListConverter : ValueConverter<List<string>, string>
|
|
{
|
|
public JsonStringListConverter() : base(
|
|
v => JsonSerializer.Serialize(v, (JsonSerializerOptions?)null),
|
|
v => JsonSerializer.Deserialize<List<string>>(v, (JsonSerializerOptions?)null) ?? new List<string>())
|
|
{
|
|
}
|
|
}
|