Базово работает
gRPC на отдельном порту
This commit is contained in:
19
src/Console/Data/BarcodesJsonConverter.cs
Normal file
19
src/Console/Data/BarcodesJsonConverter.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Text.Json;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace ConsoleApp.Data;
|
||||
|
||||
internal static class BarcodesJsonConverter
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonOptions = new();
|
||||
|
||||
public static ValueConverter<List<string>, string> Instance { get; } = new(
|
||||
v => Serialize(v),
|
||||
v => Deserialize(v));
|
||||
|
||||
private static string Serialize(List<string> value) =>
|
||||
JsonSerializer.Serialize(value, JsonOptions);
|
||||
|
||||
private static List<string> Deserialize(string value) =>
|
||||
JsonSerializer.Deserialize<List<string>>(value, JsonOptions) ?? [];
|
||||
}
|
||||
Reference in New Issue
Block a user