I assume the code you posted above is in the template? The difference between 1 and 0|1 is determined on the fact whether 1 or more of the FK fields is optional. If that's the case, the relationship side is a 0|1, otherwise it's always mandatory.
var isOptional = normalRelationship.GetFkFieldsFromFkSide().Any(f=>f.IsOptional);
tells you whether 1 or more fk fields in the normal relationship is optional. The normal relationship also has properties called 'StartEntityIsOptional' and 'EndEntityIsOptional' which you can also use. You then first have to determine which side is the 'fk side', so it comes down to:
var isOptional = normalRelationship.StartEntityIsPkSide ? normalRelationship.EndEntityIsOptional : normalRelationship.StartEntityIsOptional;
or something like that. Keep an eye on the relationshipinfo object returned by the generatorutils class, it has a lot of info too you might want to use.
In v3.5 a rule engine is in place which allows you to specify a rule based on properties of an element for an attribute, so you can define it on the project level for navigator single item and simply specify as rule that the side has to be optional.
To merge templates easier, do the following:
- keep the templates you merged the changes into your own around
- do a diff with newer released templates with this set.
- port all differences over to your own templates, then keep the newer templates around for next update.
This way work is minimal, as changes are often small.