Skip to content

Instantly share code, notes, and snippets.

View martinzima's full-sized avatar

Martin Zima martinzima

View GitHub Profile
@martinzima
martinzima / CustomNpgsqlSqlTranslatingExpressionVisitor.cs
Last active May 21, 2025 07:39
Extension for IDictionary<string, object> translation support for Npgsql.EntityFrameworkCore.PostgreSQL 5.0.0 (proof of concept). Register by calling AddJsonDictionarySupport().
using Microsoft.EntityFrameworkCore.Query;
using Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Reflection;
namespace JsonDictsGist
{
public class CustomNpgsqlSqlTranslatingExpressionVisitor : NpgsqlSqlTranslatingExpressionVisitor