SparkleNetworks / LinkedInNET

Sparkle.LinkedInNET will help you query the LinkedIn API with C# :)
https://www.nuget.org/packages/Sparkle.LinkedInNET/
GNU Lesser General Public License v3.0
35 stars 51 forks source link

Fixed issue when all fields are submitted #16

Closed differenz-manan closed 2 years ago

sandrock commented 7 years ago

Hello @differenz-manan

Thank you for this contribution. Here comes my code review.

About editing generated code

It looks like you edited the Services.tt.cs file. As you may know, this file is generated by a tool and it shall not be changed by hand. Doing so means that the changes will be lost the next time the file is generated again.

The correct way to fix the bug is to fix the code generator and then, the generate the file again.

I will add a workaround inspired from your code in the issue #15.

The real issue

This is related to issue #15.

As you may have seen, the extension methods that include fields are generated from here and here. The code seems to refer to an incorrect name.

I think the problem lie at var fullPropertyName = this.GetPropertyName(null, import.Name) + this.GetPropertyName(field.PropertyName, field.Name);

I think this code is doing something interesting in another part of the generator.

This line of the definition file might be a problem too.

Right now, I am unable to take the time necessary to fix that.