Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
DataMapper 1.6.1
-
None
-
.Net 2
Description
The typeresolver does not work with generic types that takes 2 (or more) generic parameters.
The problem lies in the "SplitTypeAndAssemblyNames" method of the "TypeAssemblyInfo" class.
The follow is a fix
================ CUT ==========================
private void SplitTypeAndAssemblyNames(string originalTypeName)
{
if (originalTypeName.StartsWith(TypeAssemblyInfo.NULLABLE_TYPE))
{
int typeAssemblyIndex = originalTypeName.LastIndexOf(TypeAssemblyInfo.NULLABLE_TYPE_ASSEMBLY_SEPARATOR);
if (typeAssemblyIndex < 0)
else
{ _unresolvedTypeName = originalTypeName.Substring(0, typeAssemblyIndex + 2).Trim(); _unresolvedAssemblyName = originalTypeName.Substring(typeAssemblyIndex + 3).Trim(); }
}
else
{
int typeAssemblyIndex = originalTypeName.LastIndexOf(TYPE_ASSEMBLY_SEPARATOR);
if (typeAssemblyIndex < 0)
{ _unresolvedTypeName = originalTypeName; }
else
{ _unresolvedTypeName = originalTypeName.Substring(0, typeAssemblyIndex).Trim(); _unresolvedAssemblyName = originalTypeName.Substring(typeAssemblyIndex + 1).Trim(); } }
}
======================= CUT =========================
Note that I changed the ".IndexOf(TYPE_ASSEMBLY_SEPARATOR)" to
".LastIndexOf(TYPE_ASSEMBLY_SEPARATOR)"
Not a brilliant fix, but I think it will do