| 294 | } |
| 295 | |
| 296 | internal static (string NamespaceName, string TypeName) SplitTypeName(string name) |
| 297 | { |
| 298 | ArgumentNullException.ThrowIfNull(name); |
| 299 | if (name.Length == 0) |
| 300 | { |
| 301 | throw new ArgumentException("registration name must not be empty", nameof(name)); |
| 302 | } |
| 303 | |
| 304 | int separator = name.LastIndexOf('.'); |
| 305 | if (separator == name.Length - 1) |
| 306 | { |
| 307 | throw new ArgumentException("registration name must end with a non-empty type name", nameof(name)); |
| 308 | } |
| 309 | |
| 310 | return separator < 0 |
| 311 | ? (string.Empty, name) |
| 312 | : (name[..separator], name[(separator + 1)..]); |
| 313 | } |
| 314 | |
| 315 | internal static void ValidateSplitTypeName(string namespaceName, string typeName) |
| 316 | { |