Skip to content

Instantly share code, notes, and snippets.

View djimmo's full-sized avatar

Djim Molenkamp djimmo

  • Amsterdam, The Netherlands
View GitHub Profile
@djimmo
djimmo / DapperableEnum.cs
Last active August 24, 2024 19:17
SqlMapper to handle Enum <-> String conversion for Dapper
using Dapper;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace DapperExtensions {
public readonly struct DapperableEnum<TEnum> where TEnum : Enum {
[JsonConverter(typeof(StringEnumConverter))]
public TEnum Value { get; }