Foxchat.NET/Foxchat.Core/Database/UlidConverter.cs

10 lines
264 B
C#
Raw Normal View History

2024-05-11 15:26:47 +02:00
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NUlid;
namespace Foxchat.Core;
public class UlidConverter() : ValueConverter<Ulid, Guid>(
convertToProviderExpression: x => x.ToGuid(),
convertFromProviderExpression: x => new Ulid(x)
2024-05-14 14:50:01 +02:00
);