Skip to content

Commit 1e2d81d

Browse files
committed
Use full name for generic types
1 parent 9e66c43 commit 1e2d81d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/EntityFrameworkCore.Generator.Core/Extensions/GenerationExtensions.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,22 @@ private static void ProcessGenericType(StringBuilder builder, Type type, Type[]
190190
var genericPartIndex = type.Name.IndexOf('`');
191191
if (genericPartIndex <= 0)
192192
{
193-
builder.Append(type.Name);
193+
if (type.Namespace.HasValue() && _defaultNamespaces.Contains(type.Namespace))
194+
{
195+
builder.Append(type.Name);
196+
}
197+
else
198+
{
199+
builder.Append(type.FullName ?? type.Name);
200+
}
194201
return;
195202
}
196203

204+
if (type.Namespace.HasValue() && !_defaultNamespaces.Contains(type.Namespace))
205+
{
206+
builder.Append(type.Namespace);
207+
builder.Append(".");
208+
}
197209
builder.Append(type.Name, 0, genericPartIndex);
198210
builder.Append('<');
199211

0 commit comments

Comments
 (0)