Simplified type name parsing was breaking if full name or assembly name has underscode ('_') in it. That breaks referencing `SQLitePCL.Batteries_V2, SQLitePCLRaw.batteries_v2` type inside `Microsoft.Data.Sqlite`
Fixes https://github.com/dotnet/efcore/issues/29725
StringBuilder typeName = new StringBuilder();
StringBuilder typeNamespace = new StringBuilder();
string containingTypeName = null;
- while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.' || name[i] == '`' || name[i] == '+'))
+ while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.' || name[i] == '_' || name[i] == '`' || name[i] == '+'))
{
if (name[i] == '.')
{
// Consume assembly name
StringBuilder assemblyName = new StringBuilder();
- while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.'))
+ while (i < name.Length && (char.IsLetterOrDigit(name[i]) || name[i] == '.' || name[i] == '_'))
{
assemblyName.Append(name[i]);
i++;