2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00
This commit is contained in:
2022-09-19 00:00:32 +03:00
parent c1b9af9e9e
commit 8e17a5b677
5 changed files with 29 additions and 22 deletions

View File

@ -354,7 +354,7 @@ public class TypeTemplate
}
public static string GetTypeClassName(Type type, string separator = ".")
public static string GetTypeClassName(Type type, char separator = '.')
{
if (type.IsGenericType)
@ -362,12 +362,12 @@ public class TypeTemplate
var index = type.Name.IndexOf("`");
var name = $"{type.Namespace}{separator}{((index > -1) ? type.Name.Substring(0, index) : type.Name)}Of";
foreach (var t in type.GenericTypeArguments)
name += GetTypeClassName(t, "_");
name += GetTypeClassName(t, '_');
return name;
}
else
return $"{type.Namespace}{separator}{type.Name}";
return $"{type.Namespace.Replace('.', separator)}{separator}{type.Name}";
}