issues with code generator - C#