Issues with C# code generation

I’ve a little problem. When I’m generation c# code I always get a number “2” after my asociation name.
I’ve looking forward to resolve this, but is a dead end.
The problem is with method $associationEnd.getVariableName(); on association.vm, in csharp templates folder.
If we look a little bit more we should be able to find that DotNetAssociationEnd.java on lib\vpplatform\com\vp\instantgenerator\dotnet folder, inside vpplatform.jar (since I think that is a common library for C# and VBNet) have the method with the problem.
My question is, we could get a fix on this problem?
If not, there is something on Velocity to make a substring?
Thank you.
Best regards.

Juan.

Well, I solved :slight_smile:
For anyone that could need it the code of association.vm below.
Best regards.

Juan.

#if($associationEnd.isNavigable() && !$associationEnd.getReferencedAttribute())
#set($orginal=$current)
#set($current=$associationEnd)
###################### Comment Start ######################
#parse("$template-path/comment.vm")
###################### Comment End ######################
${indent}#parse("$template-path/visibility.vm")
#parse("$template-path/member.vm")
#set ($lastItemIndex = $associationEnd.getVariableName().length() - 1 )
$associationEnd.getVariableType() $associationEnd.getVariableName().substring(0,$lastItemIndex);
#if($associationEnd.isProvideGetterMethod() || $associationEnd.isProvideSetterMethod())
${indent}public $associationEnd.getVariableType() $associationEnd.getPropertyName() {
###################### Getter Start ######################
#if($associationEnd.isProvideGetterMethod())
${indent}${tab}get{
${indent}${tab}${tab}return $associationEnd.getVariableName().substring(0,$lastItemIndex);
${indent}${tab}}
#end
###################### Setter Start ######################
#if($associationEnd.isProvideSetterMethod())
${indent}${tab}set{
${indent}${tab}${tab}$associationEnd.getVariableName().substring(0,$lastItemIndex) = value;
${indent}${tab}}
#end
${indent}}
#end
#set($current=$orginal)
#end

Great spot - just updated my vm with your code…

Many thanks for saving me the problem of debugging and for using the forum to post up solutions as well as problems :smiley: