diff --git a/src/EFCore.Design/Design/Internal/CSharpHelper.cs b/src/EFCore.Design/Design/Internal/CSharpHelper.cs
index 562fb412e2b..3238b555f3b 100644
--- a/src/EFCore.Design/Design/Internal/CSharpHelper.cs
+++ b/src/EFCore.Design/Design/Internal/CSharpHelper.cs
@@ -754,12 +754,57 @@ private string List(Type type, IEnumerable values, bool vertical = false)
.Append(Reference(type))
.Append(">");
+ return HandleEnumerable(builder, vertical, values, value =>
+ {
+ builder.Append(UnknownLiteral(value));
+ });
+ }
+
+ ///
+ /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
+ /// the same compatibility standards as public APIs. It may be changed or removed without notice in
+ /// any release. You should only use it directly in your code with extreme caution and knowing that
+ /// doing so can result in application failures when updating to a new Entity Framework Core release.
+ ///
+ public virtual string Literal(Dictionary dict, bool vertical = false)
+ where TKey : notnull
+ => Dictionary(typeof(TKey), typeof(TValue), dict, vertical);
+
+ private string Dictionary(Type keyType, Type valueType, IDictionary dict, bool vertical = false)
+ {
+ var builder = new IndentedStringBuilder();
+
+ builder.Append("new Dictionary<")
+ .Append(Reference(keyType))
+ .Append(", ")
+ .Append(Reference(valueType))
+ .Append(">");
+
+ return HandleEnumerable(builder, vertical, dict.Keys, key =>
+ {
+ builder.Append("[")
+ .Append(UnknownLiteral(key))
+ .Append("] = ")
+ .Append(UnknownLiteral(dict[key]));
+ });
+ }
+
+ private static string HandleEnumerable(IndentedStringBuilder builder, bool vertical, IEnumerable values, Action